Activite Script on Keyframe

I have a script. It plays an animation and then I want to activate a BoolValue. It would make the BoolValue = True. Then a camera shaking is activated. But I want the camera shake to activate at a certain point or keyframe of a animation. It would be helpful if I can found out how to write that.

Script:

 local spike = script.Spike

 local Humanoid = script.Parent.Humanoid

 local aniamtion = Humanoid:LoadAnimation(spike)

wait(1)
script.Parent.HumanoidRootPart.Anchored = true
 aniamtion:Play()

 wait(2)
 local isShake = workspace.IsShake
 isShake.Value = true
2 Likes

There’s this AnimationTrack function called :GetMarkerReachedSignal() that returns an event that fires when that specified marker is reached in animation which you can attach a function to.

2 Likes