Animation called twice when using analog trigger
I'm using Unity's in-house animation tool to animate the motion of a "sword" GameObject. The only problem is, the method swingLeftRightCenter is called when the left controller trigger is engaged at all - so it is called on the entire press and release. This results in many calls to the animation, and therefore the animation tends to run twice. How can I include a check to see whether the animation is currently playing, or otherwise prevent the animation from running more than once?
Actual sword method:
Sword swing caller (Run on every update of player):
unitycode.png
(62.2 kB)
unityplayercode.png
(12.5 kB)
Comment
Your answer
