- Home /
Animator switches animation without trigger
I have a animator with two animations each is just a sprite animation. When I transition to my Right animation it flickers that sprite animation for second and then goes right back to the Left animation. I know that my code is not doing this. I stopped for a while (like half an hour) when I was messing with which one was the default state but I had done this several times before and nothing happened.
This is my animator.
And this is my transition from Right to Left that seems to be running by itself.
Any help would be greatly appreciated
I have been working on it for a while now and still have no idea what is happening. This is really the only thing holding up my project right now.
I just did something similar to test this and it's working O$$anonymous$$ here. I have 2 states and the animator stays on the default state.
Check that the trigger wasn't set before reaching the RunningRight state, triggers stay "on" until they're used. You can see what triggers are on in the animator window. If you need to, you can set it off again using:
anim.ResetTrigger("TurnToTheLeft");
Ok so I have it working now. I selected my TurnToTheRight trigger in the animator (see below) and now it works? Not sure why so if anyone has any ideas (for why that worked or for a different solution) I would like to see them.
Your answer
Follow this Question
Related Questions
Continuously Play Animation Forwards and Backwards with Mechanim 0 Answers
Easier way of creating transitions in the animator? 1 Answer
Animator Trigger Not Working 1 Answer
How do I make the transition between two states in the "Animator" happen instantly? 3 Answers
How to get fileID information so i can just edit Mecanim Animator through script? 2 Answers