The first time the player clicks a button, my animation plays properly.
The problem is that when the player presses the button a second time, the animation does not play.
Here is the code I'm using to control my animation:
public Animator anim;
public Animator animsfirst;
public Animator animssecond;
public Animator animsthird;
public Animator reanimsfirst;
public Animator reanimssecond;
public Animator reanimsthird;
public Animator closeinstruct;
public void instructionpanel() //(instruction panel open animation)
{
anim.enabled = true; //when button click instruction panel open
animsfirst.enabled = true;
animssecond.enabled = true;
animsthird.enabled = true;
}
public void closeinstructionpanel() //(instruction panel close animation)
{
Debug.Log("animationrun"); //when button click instruction panel close
reanimsfirst.Play("freverse");
reanimssecond.Play("srevese");
reanimsthird.Play("lreverse");
closeinstruct.Play("clreverse");
}
Here is the animator controller setup for the animsfirst
object:
And for the reanimsfirst
object:
How can I resolve this issue?