Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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

0
Be sure to accept my answer if it helps! Tyler090130 619 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

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.

0
When it says animTrack:GetKeyframeReachedSignal("FootStep") -- is the "FootStep" the keyframe name in the animation? iinaoriku 52 — 4y
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! :) Tyler090130 619 — 4y
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. iinaoriku 52 — 4y
Ad

Answer this question