How do I make footstep sounds using Animation Events

Hello! There is something that I have been meaning to add to my game but have no idea how. I have been messing around with animations for my character and I came across the event animation feature. For my game, I would like to have footstep sounds that sync with when the character’s foot hits the ground. How would I go about making this?

I made the animation that has the animation events in it but I don’t know how I won’t write the code so that the sound plays when the event is triggered.

4 Likes

It would look something like this:

game.Players.LocalPlayer.Character.Humanoid.AnimationPlayed:Connect(function(track)
		if track.Name == "RunAnim" or track.Name == "WalkAnim" then --change these to your track name 
			track:GetMarkerReachedSignal("step"):Connect(function() --change "step" to the animation signal/mark
script.Parent.Step:Play() --change to the location of your sound
		end)
	end
end)

(this is a local script in StarterCharacterScripts)
It is fairly easy to create.

3 Likes

Thank you! I did not know it was that simple.

1 Like