State Machine Behaviour OnStateExit doesn't call some time.
I have a situation where 2 players are attacking each other. When one player is attacking and other one calls the super attack then i want first player to get out of the attack state and transition to other state, this works fine but OnStateExit i am turning a bool variable to false so that i could use that check to give access to other attack. OnStateExit works some time but when i stop this animation from the half then it won't work. When this state's normalised time is less than 0.8 and a bool is turned true to transition from that state to another then it won't call that state's OnStateExit method. Here's My Code:
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { Debug.Log ("Stop Attack on state exit......"); isDamageDone = false; isChairThrown = false; animator.SetBool ("attack", false); }
Your answer
Follow this Question
Related Questions
Animator MatchTarget Problem On OverRide Animation Layer (Has GIF) 0 Answers
Animator GetBehavior Question 0 Answers
Animator StateMachineBehaviour scripts are collapsed in inspector 0 Answers
How to replace an Animation State in Animator, without rebuilding all the transitions? 1 Answer
What is causing animation Position strange position changes 0 Answers