Unity 2d Animator Trying to play multiple animations at once

I have 3 animations, a PlayerIdle that starts when the game does, a player walk right (Starts when you walk right) and a player walk back (plays when you walk toward the camera)


When PlayerWalkBack is being used, it stops playing and goes back to player idle and then does back so my animation looks wierd, HLEP! Thanks!

what are the settings on the arrow going back to the node playerwalkback?

what are the settings on the player idle?


the player idle animation is set to loop?

Anything with Animations / Animators / Mechanim:

Only consider the code AFTER you have done this critical step:

Always start with the Animator state machine and prove it works in isolation, no code at all.

Here’s more reading:

Once you know 100% the animator is set up and works, move onto debugging the code.

By debugging you can find out exactly what your program is doing so you can fix it.

Use the above techniques to get the information you need in order to reason about what the problem is.

You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume it is.

Once you understand what the problem is, you may begin to reason about a solution to the problem.

Remember with Unity the code is only a tiny fraction of the problem space. Everything asset- and scene- wise must also be set up correctly to match the associated code and its assumptions.

where is this setting?

Is on the PlayerIdle animation (the one with the triangle icon)

select the animation in the project files and in the properties tab there is a loop option

nut like kurt try breaking down the logic of the flow because you may have some variables having values that trigger the other nodes

1 Like

I have figured it out, I changed my WalkBack - Idle conditions, my conditions were basically “If SpeedX > 0.1 & SpeedX < -0.1, change back” and when moving downwards, SpeedX was 0 so both of these conditions were met, so it just kept cycling back to my idle animation and switiching whenever it wanted to, I added a “If SpeedY > 0.1 & SpeedY < -0.1, go to idle animation” and it works!

Basically, Was this:

Screenshot_3

Is now this:

Just a silly mistake on my part because I didnt check properly :man_facepalming: