New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 5 days ago
Edited 5 days 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 305 — 5d

1 answer

Log in to vote
1
Answered by 5 days 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 — 5d
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 305 — 5d
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 — 5d
Ad

Answer this question