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)
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.
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!