Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I use keyframe reached in an animation in order to play sound?

I have a neat chamber animation for my gun, and I was wondering if I could use keyframe reached inorder to play a sound from a specific keyframe. Would I have to name my keyframe a specific name? How would I do this? I would really like to learn from this, thanks.

my gun that i need sound for: https://gyazo.com/d883d2e8f5c04167e7da5c7456d9b848

1 comment

0

Be sure to accept my answer if it helps!

1 answer

✓ Accepted answer

You would need to use GetMarkerReachedSignal. You can also use KeyframeReached, but that is deprecated, so use GetMarkerReachedSignal.

You can read more about GetMarkerReachedSignal here.

3 comments

0

When it says animTrack:GetKeyframeReachedSignal("FootStep") -- is the "FootStep" the keyframe name in the animation?

0

Keyframe names do not need to be unique. For example, if an Animation has three keyframes named “Particles” the connected event returned by this function will fire each time one of these keyframes is reached. Please read the link that I posted in the answer please! :)

0

I used GetMarkerReachedSignal, it doesn't work, but when I used the deprecated form, it works. Idk why it does that, it's strange; but yeah ill accept your answer anyway.

This discussion is preserved as it was. New answers, comments, and votes are closed.