Search Unity

Manual parameter chances work, code does not?

Discussion in 'Animation' started by elpuerco63, Nov 15, 2017.

  1. elpuerco63

    elpuerco63

    Joined:
    Jun 26, 2014
    Posts:
    271
    I have a parameter in my AnimationController named charInd which is an Int.

    If I play my scene and manually change this parameter value the correct animation plays, however if I use code like:

    Code (csharp):
    1.  
    2. animator.SetInteger ("CharacterIndex", charInd);
    3.  
    Where charInd is the index I am passing in although I see the parameter update in the Animator editor view the respective animation does not trigger?

    I have 10 animations in the AnimationController with zero being blank. When I start in play mode and pass in say the value 4 the animation plays because it is my first interaction, if I pass in any subsequent value the parameter is updated by the animation remains on 4?
     
    Last edited: Nov 15, 2017
  2. elpuerco63

    elpuerco63

    Joined:
    Jun 26, 2014
    Posts:
    271
    Fixed!

    needed to create transitions back to starting anim :)