I have a problem with instant transitions. I have 3 transitions (A, B and C), With A transition to B, and B Transitions to C. The transition between A and B is instantaneous (Dont have exit time and transition duration is 0). Is there any way to do the same between transition B and C?
Another question, how can i interrupted the actual transition to go automatically to default transition independently of what actual state the animator is?
I already solve the two questions, i write the answers for can be useful for someone.
In the animator, you can force to play a state with next sentence:
private Animator Character_Animator;
void Start(){
Character_Animator = this.gameObject.GetComponent<Animator>();
}
///In a public method, for example
public void do_something(){
///In this method i force to play the state that i want
this.Character_Animator.Play("State_Want_To_Play",-1,0.0f);
}
With that, In the secuence A → B → C, now is divided in A → B and A → C, with both transition instantaneously (without checked the exit time box and transition duration to 0). If is executing B and i want to go to C, i can put direcly the state C with the previos script, or go to state A and execute a trigger for go to C.