Hey everyone, I’m trying to make a script that plays a different sound based on the material a player is walking on, but I do not know the time between each footstep on a default walkspeed of 16. Does anyone know how many seconds pass between each footstep? Thanks!
1 Like
Instead of calculating the exact time between footsteps, which may vary from time to time, you could assign KeyframeMarkers on the frames of the walking animation in which the player’s foot hits the ground. KeyframeMarkers fire an event every time a certain frame in an animation is reached.
function playFootstepSound()
sound:Play() -- your walking sound here
end
local onFootstep = GetMarkerReachedSignal('step') -- whatever name you want
onFootstep:Connect(playFootstepSound)
Hope this helps ![]()
2 Likes
Thank you for your response! This is perfect for my script!
1 Like