- Home /
Animator Trigger Parameter Play Twice When Changing State(Animated GIF)
Hi Guys,
I'm making a weapon stance and it works but there is a problem...
As you can see the animation "idleA" is playing and, when the trigger is true, it will play the animation "Idleb" but for some reason returns instantly to animation "idleA" to "IdleB" to "Idle A" and as it should be to "Idle B".
Using SetBool solve this but i have to set false for every bool like: if weaponType == pistol set bool pistol true then, set bool sword false, set bool mace false and so on..
How do i solve this using the trigger parameter? Thanks in advance.
Answer by 3Danou · Mar 21, 2015 at 06:35 PM
I had the same problem, and i realise that is because i used Input.GetKey instead of Input.GetKeyDown (when i called my animation)
When i was using Input.GetKey it was calling the trigger for more then 1 frame. So the result was double animation...
Hope it help you
What about NPCs? setting the trigger based on conditions for NPCs also plays animation twice.