Search code examples
unity-game-engineanimationtransition

Unity 2D Animations: How to implement a jumping + shooting at the same time?


I'm trying to create my first computer game and I'm finding myself spending a lot of time trying to make the transitions between the character animations. I am trying to make a transition from Jumping to Shooting (which have a different animation). I am making the transition from "Any State" to jumping based on a boolean parameter which is true whenever the character is in the air and I'm making the transition to shooting based on a Trigger paramter. Whenever I'm shooting with my character while in the air, it shows the shooting animation for a moment but make the transition back to the jumping animation before finishing it (I assume because it uses the "Any State" to make the transition back to the jumping animation and not the transition between "ShootHorizontalJump). How can I make the shooting in air animation finish before going back to jumping? Thank you for you help :)

My Animator


Solution

  • If you are using an animated Sprite Sheet as an animation, You can not play two animations at the same time.
    Otherwise, You can use Animation Layer. It's same on 2D and 3D. Check here.