Question by
hedgeh0g · Nov 30, 2016 at 10:12 AM ·
animatoranimations
Know when an animation state ends.
Hello,
My gameobject has to switch to an animation stage when a given specific animation state ends. I've found this answer already: http://answers.unity3d.com/questions/362629/how-can-i-check-if-an-animation-is-being-played-or.html , I gave it try but it is not working. Here is my code:
if (_cs == characterState.Transition)
if (animator.GetCurrentAnimatorStateInfo(0).IsName("Transition"))
{
// Avoid any reload.
animator.SetInteger ("CharacterState", 3);
_cs = characterState.Walking;
Debug.Log (_cs);
}
I can't see the "Walking" animation (yes, I have double checked both the layer and the integer) and also _cs is not being printed. So, somehow I can't enter in the IF construct.
What am I doing wrong? :(
Thanks in advance.
Comment