- Home /
AnimatorTransitionInfo.IsName() Not Working
I'm trying to find out when a specific transition is happening but no luck.
Here's the code:
public Animator anim;
if(anim.GetAnimatorTransitionInfo(0).IsName("LOCOMOTION -> JUMP"))
{
Debug.Log("jump transition");
}
I only have 1 layer so that's not the problem and the argument is based on the format example provided in the unity references ("CURRENT_STATE -> NEXT_STATE").
I have also tried every combination of I could think of including "BASE_LAYER.LOCOMOTION->BASE_LAYER.JUMP".
Can any one help?
Were you able to figure this out? I'm also looking for the solution to this poorly documented method.
Answer by Werthuzad · Jul 08, 2014 at 03:44 PM
Hi, i had the same problem.
First, you probably need to change "Transition Duration" in Inspector Debug menu to some bigger number. (First I had 0 then I changed it to 0.2 and it worked).
Then, the format should look like this. Here is my code:
print (anim.GetAnimatorTransitionInfo(0).IsName("Base Layer.idle -> Base Layer.walk"));
Your answer
Follow this Question
Related Questions
Combining two animations to be one 0 Answers
Need to know when a transition starts in mecanim. 1 Answer
Make mecanim transition after a delay in Unity3D 0 Answers
Not able to use a Vector as a condition in Mecanim? 2 Answers
How to stop mesh disappearing during Animator state transition blend time? 1 Answer