Hi, I'm trying to animate my character with animator, and until today everything was fine, but something happened, i don't know if it was me or not, when playing animation it shows first 3 frames, then loops around. Everything fine with animations, that were created using "Blend tree", and others just decided to quit working.
So all the animations in the animator are separate and must be linked by conditions. how does it know when to play the jump animation or the run animation?
Can you tell us more about your animator's setup?
Yes, all animations are separate and linked with conditions. For example running animation: "Any state" --> "Running" i got paramater Speed in animator, and in code i link my characters rigidbody2D velocity on x axis to animator parameter "Speed". Then in transition from one state to another i use condition, like Speed | Greater | 0.01 | That means if i my character is moving in any direction animator makes transition and it starts to play animation. But recently my animations fckd up, i tried making new animations + creating new project, but every time it's the same: almost all animations play just 3 or 2 frames then loops.
Maybe i missed something while creating animations, but i don't know what it is :)
Answer by Merkys
Jun 13, 2014 at 10:51 AM
OK, because i found an answer myself, I'll write it not as comment, so it will be easier to see. For animations to work properly (except which are made by blending tree), transitions mustn't be from "Any state", because that means the state itself. For example if using "Any state" --> "Running" and transition goes with condition that speed is greater then 0.01, when your object tries to move in any direction it plays only first frames of animation, because that animation won't have time to play properly. And that happens because when condition is true animator through transition tells it to play, but transition comes from "Any state", it means from the same animation you try to play, and it goes in cycle never finishing animation.
P.S. if someone need clearer explanation, ask. I'll try my best.
Answer by seanyoncraic
Jun 02, 2015 at 12:59 PM
I fixed this by doing: Open Animator panel - select the transition between Any State and the state that is not playing correctly. Expand Settings in inspector and deselect "Can Transition to Self"
omg thank you, you saved me for not getting a freaking certificate :D
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
25 People are following this question.
Damn, HOW CAN I KNOW, IF MY 2d ANIMATION SPRITE IS FINISHED??!!
2D Animation does not start
Problem with character movement 2d when attaching animator
Newly Created Animations not Playing with Mecanim
Stealth Tutorial: Why does dragging an Animation onto the Inspector give me an Animator?