KeyframeReached doesn't work?

I have an animation, named keyframe.

Using KeyframeReached function, yet it never actually activates on any new code that I write.

Any old code that uses it works perfectly fine, and the new one just doesn’t work at all, and there’s no difference between them.

Irrelevant code but just incase I’m actually doing something wrong:

local combo = animator:LoadAnimation(Anim)
				combo:Play()
				combo:AdjustSpeed(1.5)
				
				combo.KeyframeReached:Connect(function(KeyframeName) -- any code below this never executes

^^^ This is new code.

As for old code:

local comboPlay = animator:LoadAnimation(comboAnim)
			comboPlay:Play()
			local damageEvent = game:GetService("ReplicatedStorage"):WaitForChild("MeleeEvents").damageEvent
			comboPlay.KeyframeReached:Connect(function(KeyframeName) -- anything under this will always work

There’s no difference between those, and it makes me lost, because there are no errors in the output, no yielding, no issues at all, it just doesn’t want to execute :question:

1 Like

Did you add keyframes to your animation?

Obviously, how would it work otherwise

Your code looks fine on both implementations. Can you give us more of the code and/or show what the animation looks like and where the triggered event is?

The only possible explanation is that your animation reaches that event before you bind the event.

Yeah, maybe he needs to bind it before playing the animation.

Sorry I forgot about this post.

This issue had the dumbest fix:

All of my previous animations were animated on 240 FPS (don’t ask why, i just liked it more)

However, the newer ones (that are used by this code), were animated on 60 FPS.

All it took was converting the new animations to 240 FPS.
I don’t know why it fixes that way, but it fixes.

Appreciate the help attempt though :v:

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