- Home /
Has Exit Time causes between trigger and transition. How can I stop this?
When I have Exit Time disabled, I can click the mouse (set the trigger) as fast as I can and it will play the animation over and over, interrupting itself (not the problem). However, I want there to be a period between the animation start and the transition so player's can't spam the attack button. It will be interrupting itself, but will have a minimum amount of time the animation must be played. When Has Exit Time is enabled and set it to 0.75, the small period between the beginning of the animation and the transition is there, giving me the result I want.
The problem: When Has Exit Time is enabled, there will be a delay between when the trigger is set and when the transition happens. The delay often has a random duration. Sometimes the delay is half a second, sometimes it's a full second. I want the animation to play instantly when I click the mouse, and have a small delay before the clicking of the mouse can play it again.
Answer by Komokara · Jun 02, 2018 at 07:16 PM
I found a work around. I'm just going to delay when the script sets the trigger by grabbing the normalized time and saying that if it's after a certain time, I'm allowed to set the trigger.
//anim is Animator Component if(anim.GetCurrentAnimatorStateInfo(0).normalizedTime > 0.7) { anim.SetTrigger("Swing"); }
Your answer
Follow this Question
Related Questions
Animations not transitioning properly 1 Answer
Animator does not reset well when reactivating object 3 Answers
Smooth transition of position between animations 0 Answers
Trigger not playing Animation 0 Answers