Currently, I just use the time of the animations to decide when the best moment to turn on and turn off the hitboxes are, however, I feel like this isn’t good at being accurate.
The DoAction()
function has an argument for the hitbox which takes a table with 2 values swingStart and swingFInish. swingStart means the hitbox should turn on .8 seconds into the animation and the same idea for swingFinish.
local actionName = "Ability1"
local swingStart = 0.8
local swingFinish = self.player.Animation:GetAnimationLength(actionName) - 0.8
Warrior:DoAction(self.player,{swingStart,swingFinish},actionName)
The only other solution I can think of is using animation events or keyframe events, however, was too lazy to go through every animation and actually do that so perhaps there’s another solution before I have to do this.