[Solved]There is a delay between setInteger and the animation
I have an animation that is called through "Any state" in Animator. The transition have HasExitTime unchecked, and the transition is called after setting a variable called "injured" to 1.
The problem is that when I set that "injured" parameter to 1 through my personal script Animator Controller using setInteger("injured",1), sometimes the animation have a delay, and sometimes it doesn't have that delay.
I'm sure that the parameter "injured" is setted to 0 after the animation have been played through a StateMachineBehaviour, and the parameter of make transition with himself is unchecked too (to make sure it's called once).
The setting of the parameter is done through OnCollisionEnter, and maybe the combination of updates of PhysX and Animations is problematic.
It's important for my game to have an instant player reaction, to have 0,1 seconds of delay sometimes is a problem.
Answer by Telojuri94 · Feb 02, 2017 at 03:15 PM
The problem was because the tranitions. When the parameter is setted to 1 in the middle of a Transition, if you have [None] in the Interruption Source parameter of the Settings from transition, the animation wont be played until that transition ends. I've solved this setting all the Interruption Source from all Transitions to "Next State".
Your answer
Follow this Question
Related Questions
Unwanted delay between animation clips 0 Answers
How to Remove Delay in Button Click to Animation 0 Answers
Can't rearrange animation parameters 0 Answers
2D Animation Problem. 0 Answers
Can't add condition to a transition in animator controller 0 Answers