How can i make a dynamic footstep system?

I’m trying to make a dynamic footstep system, i know that i need to use a GetMarkerReachedSignal but it doest seem to work, can someone help me?

this is my code:

local Snd = game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Running

Snd:Destroy()

local Anim = game:GetService("Players").LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animate.walk.WalkAnim)

Anim:GetMarkerReachedSignal("Step_1"):Connect(function()
	local FootStep = game.ReplicatedStorage:WaitForChild("Audio_Editado_1"):Clone()
	FootStep.Parent = game:GetService("Players").LocalPlayer.Character
	FootStep:Play()
end)

if someone knows a better way to do it feel free to tell me

1 Like

are you trying to use as least variables as possible or what

and whats the problem with that?

What exactly do you mean by dynamic footsteps? Do you mean foot planting using inverse kinematics or…?

no, like when the player steps it actually plays a sound, i saw some videos and posts and its how people call it i think

Im pretty sure roblox’s default animation script when you load a character has that so you could just rip it off from that script

yeah its honestly just easier if you sync up a looping sound to the animation, doesn’t have to be 100% accurate

yeah, it has, but i think that it works not in the way that i want, it just plays a sound, not caring if the player foot is landing or not on the ground

do you think that it would have the same effect?

what do you mean by effect? im sure players wont notice or care if the sounds don’t link up with the animation.

1 Like

This is the struggle I have with my game is I know that most people won’t even notice the slight discrepancies but I notice, and it makes me think they will and that makes me spend way too long trying to fix it xD

2 Likes

yeah, i think that the same thing would happen to me

Are you sure you’re using KeyframeMarkers in the animation? It’s not the same as Naming a Keyframe since this fires the KeyframeReached event instead.

yes, i’m pretty sure that i am doing that

I think the reason its not actually is playing is because you loaded the animation but the animation is not actually played

If your animation is loaded and played separately in another script or as another variable then the GetMarkerReachedSignal would never fire because its not directly connected to the animation thats actually playing

3 Likes

i’m gonna try to make it on the animate script

1 Like

i tried it and it still didnt work