First Person Melee Attack Animations Occassionally Playing Multiple Times

Tester115

Member
Hello,

I have noticed in my project that when I attack with a melee weapon, the attack animation will occasionally play twice or more. Could this be an input/framerate issue with it firing multiple times? If so, how could I correct this? Or could it have something to do with the OnAnimatorItemUse and OnAnimatorItemUseComplete in the sword animation being called too early in the timeline? Any help would be greatly appreciated. It may also be useful to mention that I am using a controller for this.
 
Are you able to repro this in the demo scene at all? Also one thing worth checking is if this also happens in a build or just in the editor.
 
Are you able to repro this in the demo scene at all? Also one thing worth checking is if this also happens in a build or just in the editor.
The issue happens in builds and in the editor. I'll check the demo scene.

Edit: It doesn't appear to happen in the demo scene. Do you all know which settings could be affecting this so that I can better narrow down the cause of the issue?
 
Last edited:
So it seems like the issue happens while I have a controller plugged in. I have the attack button tied to the triggers of an Xbox controllers while it is plugged in. Could the triggers of an Xbox controller be firing twice?
 
Hm, possibly - I'm not familiar with how Unity receives input from an Xbox controller, so you may want to do some basic testing to check this, e.g. does it only receive a 0 or 1 based on if the trigger is fully pressed in? Abilities use GetButton by default so if the trigger returns continuous floating point values even when not fully pressed in, then that might be the cause.
 
Top