- Home /
2D Getting animation state..
Hi,
How are you supposed to react to the state of an animation. I want to do someting as soon as the animation gets to the 'down' state. If I make a while loop checking it, it just dies. I want to do something as soon as I reach a state.
Code below.. jcont.SState() gets the current state of the animation and returns "complete" if its at the 'down' state. it works if i remove the loop and run jcount.SState() by clicking a button over and over.
string returnState = "";
while (retState != "complete") {
returnState = jcont.SState();
}
Comment
Best Answer
Answer by Trungdv · Nov 26, 2014 at 04:47 AM
I don't clearly understand your question, but I think maybe this is what you need: http://docs.unity3d.com/Manual/animeditor-AnimationEvents.html
Your answer
![](https://koobas.hobune.stream/wayback/20220613172436im_/https://answers.unity.com/themes/thub/images/avi.jpg)