title: How do change Spine animations in Unity?
body: <p>I have a conditional if then statement running where I want the animations to change if a certain condition is met.  For some reason when it starts, the correct animation plays, but when it is changed the animation doesn't change.  The code is running in <code>LateUpdate()</code>.  I made a hack to test the changing of the animations and it won't work either.</p>
  
  <p>Everything I have read says to use <code>SetAnimation</code> and it will over ride the previous animation, but this doesn't seem to be working.  Here is the code to hack that result I want.</p>
  
  <pre><code>rightCrowdMemberAnimation.state.SetAnimation (0, "idle_07", true);
  
  if (Input.GetKeyDown (KeyCode.A)) {
  
  rightCrowdMemberAnimation.state.SetAnimation (0, "yay_07", true);
  
  }
  </code></pre>
  
  <p>Thanks for the help.</p>
  
  <p>What is weird is that the in the inspector it says that the animation has changed, but visually it hasn't changed.</p>
  
  <p>Note: This is what i was trying to accomplish.  It appears that while I was in <code>LateUpdate</code>it was resetting back to the idle when I clicked A.  I am still not sure why it won't change the animation under what is below.  I thought the A button trick was similar in execution, but I guess I was wrong.</p>
  
  <pre><code>void Start(){
      Assume I did a random roll of color {red,blue,yellow}
  }
  </code></pre>
  
  <p>The real issue is</p>
  
  <pre><code>void LateUpdate(){
       if (color = red) {
           rightCrowdMemberAnimation.state.SetAnimation (0, "idle_07", true);
       } else if (color = blue) {
           rightCrowdMemberAnimation.state.SetAnimation (0, "idle_08", true);
       } else if (color = yellow){
           rightCrowdMemberAnimation.state.SetAnimation (0, "idle_09", true);
       }
  }
  </code></pre>
  
  <p>In the inspector the animation I want to show up is there. Just the animation that I am calling isn't showing up.</p>