Which method is better for scripting attacks?

Alright so, I’ve started scripting a BG game, but I still haven’t figured out which way I should do this…
In my old games, I’ve always checked how long it takes for the animation to reach a certain point, and then ran the code after that.
(For example, the punch is supposed to hit the enemy at 0.5 in the animation, so I’d wait 0.5 seconds and then create a hitbox)

However, I’ve seen people do AnimationTrack:GetMarkerReachedSignal. I’ve been wondering if that is a better method than what I was doing before.

Also, I’m sorry for the slightly bad title. I couldn’t really come up with a fitting title for this.

AnimationTrack:GetMarkerReachedSignal will allow you to switch out an animation without having to change wait durations within your scripts, so take it as you will. I would like to think it is better than manually creating wait durations.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.