Hi, I’m new to coding when it comes to animations - I was wondering if there was anyway to make a line of code Wait() until an Animation reaches a certain point. Whether it be keyframes or what-not, I’ve read up on the Wiki but I often like to hear other peoples understandings of things!
It’s better to use Keyframes, because your animation could stop or its speed is changed. In any animation editor, you can click (right-click) or whatever on a keyframe to rename it. If you use moon animation suite, these are called “Labels”.
If you have already named your Keyframes and have exported the animation, you need to use GetMarkerReachedSignal, which returns an event that will fire whenever a specified Keyframe has been reached:
-- this code is just an example
local anim = humanoid:LoadAnimation(anim)
anim:GetMarkerReachedSignal("KeyframeNameHere"):Connect(function()
print("reached keyframe, initiating...")
end)