Hi there,
I've started experimenting with a new game and I have some questions regarding jumping and falling.
For context: I'm using Rigidbody2D, a Circle Collider 2D, and the Direct Movement method.
I've noticed that jumping seems to be disabled, which is fine since I'm not planning to implement it. However, I would like to handle a falling animation for when the character is not touching the ground.
I could set something up quickly with triggers, but is there a better approach that works out of the box?
I noticed there's a "Ground" layer and the player has a GroundCheck, but since jumping is disabled, I'm not sure how to make use of that. Ideally, I'd like the player controller to play a falling animation (left or right) whenever the character is in the air.
If I can offer more information, please let me know. Also, out of curiosity, is there a way to enable jumping in 2D or is it still causing issues?
As always, thank you in advance for your help. Have a wonderful weekend!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
If you set your Player's animation engine to Sprites Unity Complex, you'll have access to an "Is Grounded" bool parameter that you can use in their Animator Controller.
AC's Sample Player 3D prefab also has a "Player Land" component that automatically triggers a land animation after falling from a given height. Though it's intended for 3D, it should work in 2D as well.
AC's jumping feature isn't available in 2D. Platforming movement is a broad topic and - if you're looking to have such control in your game, it's best to incorporate a dedicated asset for your Player's motion controller and have AC relinquish motion control of the Player during gameplay.
Thank you, Chris! That's all I needed! I can live without jump. I can always make a fake scripted jump if needed. Thank you again, have a wonderful rest of the weekend!