hi, I am only interested in having my character in 2d move left and right, not up or down. i have a "base pose" where they look straight on to the camera (down) and want to have it be the idle position. however, I am not interested it in moving up or down the scene, just left to right. as of now, my character's idle down position slides down and up. is there any way to mitigate this?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @antijules.
Are you looking to have left- and right-facing idle animations as well, or to have down-facing to be the only idle animation?
You can configure which directions a character can face in their Inspector by editing their Facing directions field. However, this applies to both movement and idle directions.
The "quick-and-dirty" way to achieve this would be to rely on Sprites Unity animation, and just have all of the Animator Controller's idle states rely on the same down-facing animation.
You needn't duplicate the animation for each direction: this can simply be a case of placing it in the Animator Controller three times and renaming each state inside it to match the character's list of "Expected animations", i.e. "Idle_D", "Idle_R", "Idle_L".
See this tutorial for details on working with this animation method.
The more "proper" approach would be to instead rely on Sprites Unity Complex animation, which relies on manipulating Animator parameters to control which animation is played. Using this technique, you could create an animation state-machine that causes the "down-facing idle" animation to play whenever the "Move speed" float parameter drops below a certain threshold - regardless of which direction they may be facing.
More on this topic can be found in the Manual's "Character animation (Sprites Unity Complex)" chapter. If you'd like to share screenshots of what your current setup is, however, I can try to give more specific advice.