- Home /
 
 
               Question by 
               DiscoFever · Nov 11, 2015 at 05:49 PM · 
                2danimatormecanimanimations  
              
 
              Get Animator current Animation using script ? Possible ?
I have this simple animator; 2 layers, Idle and Walking and a Blend Tree
I'm trying to catch if a specific animation is currently playing:
 _anim = GetComponent<Animator>();
 if( _anim.GetCurrentAnimatorStateInfo(0).IsName("Idle.IdleLeft"))
 {
     Debug.Log ("Idle Left !");
 }   
 
               But i cannot get it to work. What am I obviously missing here ? Thanks !
 
 
                 
                capture-decran-2015-11-11-a-173037.png 
                (12.9 kB) 
               
 
                
                 
                capture-decran-2015-11-11-a-173030.png 
                (31.4 kB) 
               
 
              
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
2D Animation does not start 1 Answer
How to blend two layers additive then override others 0 Answers
Unity Mecanim Play two animations [UPDATED] 2 Answers
Root Motion On Slow Animations 0 Answers
How do I construct my animation state machine this way? 0 Answers