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(); 


}

I don’t clearly understand your question, but I think maybe this is what you need:
http://docs.unity3d.com/Manual/animeditor-AnimationEvents.html