local Players = game:GetService("Players") local character = Players.LocalPlayer.Character if not character then character = Players.LocalPlayer.CharacterAdded:Wait() end local humanoid = character:WaitForChild("Humanoid") local walkAnim = Instance.new("Animation") walkAnim.AnimationId = "rbxassetid://4547055626" local walkAnimTrack = humanoid:LoadAnimation(walkAnim) walkAnimTrack:GetMarkerReachedSignal("FootStep"):Connect(function(paramString) -- Perform desired action such as playing a custom footstep sound print(paramString) end)
I need help, ¿what's wrong?
Looks like you forgot to play the animation track. For the GetMarkerReachedSignal connection to work, the animation must reach the marker, so it has to be played. Calling the track should work fine:
local Players = game:GetService("Players") local character = Players.LocalPlayer.Character or Players.LocalPlayer.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local walkAnim = Instance.new("Animation") walkAnim.AnimationId = "rbxassetid://4547055626" local walkAnimTrack = humanoid:LoadAnimation(walkAnim) walkAnimTrack:Play() walkAnimTrack:GetMarkerReachedSignal("FootStep"):Connect(function(paramString) -- Perform desired action such as playing a custom footstep sound print(paramString) end)