Hey, I’ve been working on this FPS framework and since I’ve gotten to the stage of animating the viewmodels, I must add sound. I’ve looked everywhere on the devforum and I don’t see a perfect solution to solving my problem.
I want to sync sounds to animation keyframes and I don’t know where to start.
you can right click on a keyframe to add an animation event/signal with a name and a parameter
from there hook the animation to a marker signal
animation:GetMarkerReachedSignal("Audio"):Connect(function(id)
--"id" is the parameter in the inserted animation marker
local audio = Instance.new("Sound")
audio.SoundId = "rbxassetid://"..id
audio.Parent = self.Character.Head
audio:Play()
audio.Ended:Connect(function()
audio:Destroy()
end)
end)
to generate a sound everytime this marker is reached