In short
In a LocalScript in StarterCharacterScripts, read humanoid.FloorMaterial every frame. While it is not Enum.Material.Air and the character is moving, add the distance walked to a counter; every 5 or so studs, play a step sound chosen by the material, such as a Grass sound for Grass and LeafyGrass. Clone the Sound into the HumanoidRootPart so it comes from the player's feet, and give each step a slightly random PlaybackSpeed so it never sounds like a loop.
- Footsteps are only sound, so they belong on the client. No RemoteEvents are needed.
- Counting distance instead of time makes steps faster when the player sprints, with no extra code.
- Mute Roblox's default running sound, or players hear two sets of footsteps.
Get the script
Footstep sounds by floor material
A LocalScript in StarterCharacterScripts that plays grass, stone, wood, metal, sand, snow or water steps from FloorMaterial, plus a landing sound.
-- LocalScript in StarterCharacterScripts named Footsteps.
-- Plays a step sound for this player's character, chosen by the floor material.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local STRIDE = 5.5 -- studs walked between two steps
local MIN_SPEED = 2 -- slower than this counts as standing still
-- Which sound group each material uses. Anything missing uses "Default".
local GROUPS: { [Enum.Material]: string } = {
[Enum.Material.Grass] = "Grass",
[Enum.Material.LeafyGrass] = "Grass",
[Enum.Material.Ground] = "Grass",
[Enum.Material.Mud] = "Grass",
[Enum.Material.Concrete] = "Stone",
[Enum.Material.Rock] = "Stone",
[Enum.Material.Slate] = "Stone",
[Enum.Material.Granite] = "Stone",
[Enum.Material.Basalt] = "Stone",
[Enum.Material.Limestone] = "Stone",
[Enum.Material.Marble] = "Stone",
[Enum.Material.Sandstone] = "Stone",
[Enum.Material.Brick] = "Stone",
[Enum.Material.Cobblestone] = "Stone",
[Enum.Material.Pavement] = "Stone",
[Enum.Material.Asphalt] = "Stone",
[Enum.Material.CeramicTiles] = "Stone",
[Enum.Material.Pebble] = "Stone",
[Enum.Material.Wood] = "Wood",
[Enum.Material.WoodPlanks] = "Wood",
[Enum.Material.Metal] = "Metal",
[Enum.Material.DiamondPlate] = "Metal",
[Enum.Material.CorrodedMetal] = "Metal",
[Enum.Material.Foil] = "Metal",
[Enum.Material.Sand] = "Sand",
[Enum.Material.Salt] = "Sand",
[Enum.Material.Snow] = "Snow",
[Enum.Material.Glacier] = "Snow",
[Enum.Material.Ice] = "Snow",
[Enum.Material.Water] = "Water",
}
local character = script.Parent :: Model
local humanoid = character:WaitForChild("Humanoid") :: Humanoid
local root = character:WaitForChild("HumanoidRootPart") :: BasePart
local soundFolder = ReplicatedStorage:WaitForChild("FootstepSounds")
-- Roblox's default character sounds include a "Running" Sound in the HumanoidRootPart.
-- Keep it silent so there is only one set of footsteps.
local function muteDefault(child: Instance)
if child:IsA("Sound") and child.Name == "Running" then
child.Volume = 0
child:GetPropertyChangedSignal("Volume"):Connect(function()
if child.Volume ~= 0 then
child.Volume = 0
end
end)
end
end
for _, child in root:GetChildren() do
muteDefault(child)
end
root.ChildAdded:Connect(muteDefault)
-- A group is a Sound, or a Folder of Sounds to pick from at random
local function pickSound(group: string): Sound?
local entry = soundFolder:FindFirstChild(group) or soundFolder:FindFirstChild("Default")
if entry and entry:IsA("Sound") then
return entry
end
if entry then
local options = entry:GetChildren()
if #options > 0 then
local choice = options[math.random(1, #options)]
if choice:IsA("Sound") then
return choice
end
end
end
return nil
end
local function playStep(material: Enum.Material, loudness: number)
local template = pickSound(GROUPS[material] or "Default")
if not template then
return
end
local sound = template:Clone()
sound.Volume = template.Volume * loudness
-- A slightly different pitch each step, so it never sounds like a loop
sound.PlaybackSpeed = template.PlaybackSpeed * (0.9 + math.random() * 0.2)
sound.Parent = root -- in the root part, so the sound comes from the character
sound:Play()
sound.Ended:Once(function()
sound:Destroy()
end)
task.delay(5, function()
sound:Destroy() -- in case Ended never fires, for example when the audio fails to load
end)
end
local travelled = 0
RunService.Heartbeat:Connect(function(deltaTime: number)
local material = humanoid.FloorMaterial
local velocity = root.AssemblyLinearVelocity
local speed = Vector3.new(velocity.X, 0, velocity.Z).Magnitude -- sideways speed only
if material == Enum.Material.Air or speed < MIN_SPEED or humanoid.Health <= 0 then
travelled = STRIDE * 0.6 -- the first step comes quickly when you start walking again
return
end
travelled += speed * deltaTime
if travelled >= STRIDE then
travelled -= STRIDE
playStep(material, 1)
end
end)
-- A louder step when landing from a jump or a fall
humanoid.StateChanged:Connect(function(_old: Enum.HumanoidStateType, new: Enum.HumanoidStateType)
if new == Enum.HumanoidStateType.Landed then
playStep(humanoid.FloorMaterial, 1.5)
end
end)
RoCode builds it in the place you have open in Roblox Studio, on Windows or macOS with a desktop browser; on a phone the button sends the prompt and the link to your computer. Free to start, with free credits every day. More Roblox Studio scripts
Where to put it
ReplicatedStorage
FootstepSounds Folder new
Default Sound
Grass Sound
Stone Sound
Wood Folder
Wood1 Sound
Wood2 Sound
StarterPlayer
StarterCharacterScripts
Footsteps LocalScript new
Settings you can change
STRIDEIn the script- Studs walked between two steps. Lower for quick little steps, higher for long strides. Default:
5.5. MIN_SPEEDIn the script- Below this speed in studs per second the character counts as standing still. Default:
2.
Each entry in FootstepSounds is a Sound or a Folder of Sounds (one is picked at random). Name them after the groups in GROUPS; Default is used for anything else.
Type-checked with luau-lsp strict against Roblox's API definitions on 14 November 2026. Not playtested in Studio yet: press Play and watch the Output window before you publish.
Prompt for RoCode
Add footstep sounds that change with the floor: a FootstepSounds folder in ReplicatedStorage with Default, Grass, Stone, Wood, Metal, Sand, Snow and Water sounds, and a LocalScript in StarterCharacterScripts that reads Humanoid.FloorMaterial, plays a step every 5.5 studs walked with a random pitch, plays a landing sound, and mutes the default Running sound.
On this page
How material footsteps work
Humanoid.FloorMaterial is a read-only property that holds the Enum.Material of whatever the character stands on. It works for parts and for Terrain, and it is Air while jumping or falling. Roblox has more than 40 materials, so the script sorts them into a few sound groups:
| Sound group | Materials in it |
|---|---|
| Grass | Grass, LeafyGrass, Ground, Mud |
| Stone | Concrete, Rock, Slate, Granite, Basalt, Limestone, Marble, Sandstone, Brick, Cobblestone, Pavement, Asphalt, CeramicTiles, Pebble |
| Wood | Wood, WoodPlanks |
| Metal | Metal, DiamondPlate, CorrodedMetal, Foil |
| Sand | Sand, Salt |
| Snow | Snow, Glacier, Ice |
| Water | Water (shallow water you can stand in) |
| Default | Everything else, such as Plastic and SmoothPlastic |
The timing comes from distance. Each frame, the script adds how far the character moved sideways to a counter. When the counter passes STRIDE studs, it plays a step and starts again. At the default WalkSpeed of 16 that is about three steps a second, and a sprinting player at 28 gets about five.
Step 1: Add the footstep sounds
- Hover over ReplicatedStorage, click + and insert a Folder. Name it
FootstepSounds. - Open the Toolbox, choose the Audio category and search for footstep sounds, such as "footstep grass" or "footstep wood". Pick short sounds, under half a second.
- For each sound you want, insert a Sound into FootstepSounds and paste the audio's ID into SoundId. Name the Sound after its group:
Grass,Stone,Wood,Metal,Sand,Snow,Water. Add one namedDefaultfor every other floor. - For variety, make a Folder named after the group instead (for example
Wood) and put two or three Sounds inside. The script picks one at random each step. - Set each Sound's Volume to about 0.5 and RollOffMaxDistance to about 60, so steps fade out over 60 studs.
Step 2: The footstep LocalScript
- In the Explorer, open StarterPlayer, hover over StarterCharacterScripts, click + and insert a LocalScript.
- Name it
Footstepsand paste the code below. Roblox copies it into your character every time you spawn.
-- LocalScript in StarterCharacterScripts named Footsteps.
-- Plays a step sound for this player's character, chosen by the floor material.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local STRIDE = 5.5 -- studs walked between two steps
local MIN_SPEED = 2 -- slower than this counts as standing still
-- Which sound group each material uses. Anything missing uses "Default".
local GROUPS: { [Enum.Material]: string } = {
[Enum.Material.Grass] = "Grass",
[Enum.Material.LeafyGrass] = "Grass",
[Enum.Material.Ground] = "Grass",
[Enum.Material.Mud] = "Grass",
[Enum.Material.Concrete] = "Stone",
[Enum.Material.Rock] = "Stone",
[Enum.Material.Slate] = "Stone",
[Enum.Material.Granite] = "Stone",
[Enum.Material.Basalt] = "Stone",
[Enum.Material.Limestone] = "Stone",
[Enum.Material.Marble] = "Stone",
[Enum.Material.Sandstone] = "Stone",
[Enum.Material.Brick] = "Stone",
[Enum.Material.Cobblestone] = "Stone",
[Enum.Material.Pavement] = "Stone",
[Enum.Material.Asphalt] = "Stone",
[Enum.Material.CeramicTiles] = "Stone",
[Enum.Material.Pebble] = "Stone",
[Enum.Material.Wood] = "Wood",
[Enum.Material.WoodPlanks] = "Wood",
[Enum.Material.Metal] = "Metal",
[Enum.Material.DiamondPlate] = "Metal",
[Enum.Material.CorrodedMetal] = "Metal",
[Enum.Material.Foil] = "Metal",
[Enum.Material.Sand] = "Sand",
[Enum.Material.Salt] = "Sand",
[Enum.Material.Snow] = "Snow",
[Enum.Material.Glacier] = "Snow",
[Enum.Material.Ice] = "Snow",
[Enum.Material.Water] = "Water",
}
local character = script.Parent :: Model
local humanoid = character:WaitForChild("Humanoid") :: Humanoid
local root = character:WaitForChild("HumanoidRootPart") :: BasePart
local soundFolder = ReplicatedStorage:WaitForChild("FootstepSounds")
-- Roblox's default character sounds include a "Running" Sound in the HumanoidRootPart.
-- Keep it silent so there is only one set of footsteps.
local function muteDefault(child: Instance)
if child:IsA("Sound") and child.Name == "Running" then
child.Volume = 0
child:GetPropertyChangedSignal("Volume"):Connect(function()
if child.Volume ~= 0 then
child.Volume = 0
end
end)
end
end
for _, child in root:GetChildren() do
muteDefault(child)
end
root.ChildAdded:Connect(muteDefault)
-- A group is a Sound, or a Folder of Sounds to pick from at random
local function pickSound(group: string): Sound?
local entry = soundFolder:FindFirstChild(group) or soundFolder:FindFirstChild("Default")
if entry and entry:IsA("Sound") then
return entry
end
if entry then
local options = entry:GetChildren()
if #options > 0 then
local choice = options[math.random(1, #options)]
if choice:IsA("Sound") then
return choice
end
end
end
return nil
end
local function playStep(material: Enum.Material, loudness: number)
local template = pickSound(GROUPS[material] or "Default")
if not template then
return
end
local sound = template:Clone()
sound.Volume = template.Volume * loudness
-- A slightly different pitch each step, so it never sounds like a loop
sound.PlaybackSpeed = template.PlaybackSpeed * (0.9 + math.random() * 0.2)
sound.Parent = root -- in the root part, so the sound comes from the character
sound:Play()
sound.Ended:Once(function()
sound:Destroy()
end)
task.delay(5, function()
sound:Destroy() -- in case Ended never fires, for example when the audio fails to load
end)
end
local travelled = 0
RunService.Heartbeat:Connect(function(deltaTime: number)
local material = humanoid.FloorMaterial
local velocity = root.AssemblyLinearVelocity
local speed = Vector3.new(velocity.X, 0, velocity.Z).Magnitude -- sideways speed only
if material == Enum.Material.Air or speed < MIN_SPEED or humanoid.Health <= 0 then
travelled = STRIDE * 0.6 -- the first step comes quickly when you start walking again
return
end
travelled += speed * deltaTime
if travelled >= STRIDE then
travelled -= STRIDE
playStep(material, 1)
end
end)
-- A louder step when landing from a jump or a fall
humanoid.StateChanged:Connect(function(_old: Enum.HumanoidStateType, new: Enum.HumanoidStateType)
if new == Enum.HumanoidStateType.Landed then
playStep(humanoid.FloorMaterial, 1.5)
end
end)
The script uses the root part's AssemblyLinearVelocity with the up-and-down part removed, so falling does not count as walking. When the character stops or leaves the ground, the counter is set to 60 percent of a stride. That way the first step plays just after you start walking, instead of after a full silent stride.
Because the script lives in the character, it is removed with the character when you die, and its Heartbeat connection goes with it. When you respawn, Roblox puts a fresh copy into the new character.
Turning off the default footsteps
Roblox gives every character a set of built-in sounds: jumping, landing, swimming and a running sound. Your device creates them inside the HumanoidRootPart. The running sound is a Sound named Running, and the muteDefault function in Step 2 sets its Volume to 0 and keeps it there.
To check it in your game, press Play, open your character in the Explorer (Workspace, then your name), expand HumanoidRootPart and look for Running. If your game uses a custom character or changes the default sound names, change the name in muteDefault to match what you see there.
Step 3 (optional): Hear other players' footsteps
Step 2 only plays your own footsteps. Sounds played by a LocalScript are only heard on that device, so other players hear nothing. To hear everyone, each device plays the footsteps of every nearby character itself. So that it does not depend on how other players' Humanoids update on your device, this version does not read their FloorMaterial. It casts a short ray down from each character and reads the Material of what the ray hits, which works for Terrain too.
- Delete the Footsteps LocalScript from StarterCharacterScripts, or you will hear your own steps twice.
- Hover over StarterPlayerScripts and insert a LocalScript named
AllFootsteps. Paste the code below. - Copy the
GROUPStable from Step 2 into the place marked in the code. It is left short here to keep the script readable.
-- LocalScript in StarterPlayerScripts named AllFootsteps.
-- Plays footsteps for every character near this player's camera, using a ray to find the floor.
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local STRIDE = 5.5 -- studs walked between two steps
local MIN_SPEED = 2 -- slower than this counts as standing still
local HEAR_DISTANCE = 80 -- characters farther from the camera than this are skipped
local RAY_LENGTH = 5 -- studs below the root part to look for a floor
-- Paste the full GROUPS table from Step 2 here
local GROUPS: { [Enum.Material]: string } = {
[Enum.Material.Grass] = "Grass",
[Enum.Material.Wood] = "Wood",
[Enum.Material.WoodPlanks] = "Wood",
[Enum.Material.Concrete] = "Stone",
[Enum.Material.Metal] = "Metal",
[Enum.Material.Sand] = "Sand",
}
local soundFolder = ReplicatedStorage:WaitForChild("FootstepSounds")
local travelled: { [Model]: number } = {}
local function pickSound(group: string): Sound?
local entry = soundFolder:FindFirstChild(group) or soundFolder:FindFirstChild("Default")
if entry and entry:IsA("Sound") then
return entry
end
if entry then
local options = entry:GetChildren()
if #options > 0 then
local choice = options[math.random(1, #options)]
if choice:IsA("Sound") then
return choice
end
end
end
return nil
end
local function playStep(root: BasePart, material: Enum.Material)
local template = pickSound(GROUPS[material] or "Default")
if not template then
return
end
local sound = template:Clone()
sound.PlaybackSpeed = template.PlaybackSpeed * (0.9 + math.random() * 0.2)
sound.Parent = root
sound:Play()
sound.Ended:Once(function()
sound:Destroy()
end)
task.delay(5, function()
sound:Destroy()
end)
end
-- Mute the default "Running" sound on every character, not just this player's
local function muteDefault(child: Instance)
if child:IsA("Sound") and child.Name == "Running" then
child.Volume = 0
child:GetPropertyChangedSignal("Volume"):Connect(function()
if child.Volume ~= 0 then
child.Volume = 0
end
end)
end
end
local function onCharacter(character: Model)
local root = character:WaitForChild("HumanoidRootPart", 10)
if root then
for _, child in root:GetChildren() do
muteDefault(child)
end
root.ChildAdded:Connect(muteDefault)
end
character.Destroying:Connect(function()
travelled[character] = nil
end)
end
local function onPlayer(player: Player)
if player.Character then
task.spawn(onCharacter, player.Character)
end
player.CharacterAdded:Connect(onCharacter)
end
for _, player in Players:GetPlayers() do
onPlayer(player)
end
Players.PlayerAdded:Connect(onPlayer)
RunService.Heartbeat:Connect(function(deltaTime: number)
local camera = workspace.CurrentCamera
for _, player in Players:GetPlayers() do
local character = player.Character
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
local root = humanoid and humanoid.RootPart
if not (character and humanoid and root) or humanoid.Health <= 0 then
continue
end
if (root.Position - camera.CFrame.Position).Magnitude > HEAR_DISTANCE then
continue -- too far away to hear
end
local velocity = root.AssemblyLinearVelocity
local speed = Vector3.new(velocity.X, 0, velocity.Z).Magnitude
local params = RaycastParams.new()
params.ExcludeInstances = { character }
local floor = workspace:Raycast(root.Position, Vector3.new(0, -RAY_LENGTH, 0), params)
if not floor or speed < MIN_SPEED then
travelled[character] = STRIDE * 0.6
continue
end
local distance = (travelled[character] or 0) + speed * deltaTime
if distance >= STRIDE then
distance -= STRIDE
playStep(root, floor.Material)
end
travelled[character] = distance
end
end)
Each device does this work for the characters near its own camera, so a 30-player server does not mean 30 sets of footsteps everywhere. HEAR_DISTANCE skips anyone too far away to hear. A ray 5 studs down from the root part reaches the floor for both R15 and R6 characters standing on the ground; while they are in the air the ray finds nothing and they make no sound.
Step 4: Test it
- Build a test path: a few Parts in a row with different Material values, such as Grass, WoodPlanks, Concrete and Metal. A patch of Terrain grass works too.
- Press Play and walk across them. The step sound changes as you cross from one part to the next.
- Jump: no steps while in the air, then a louder thud when you land.
- Change your WalkSpeed to 28 in the Properties window while playing (select your Humanoid): steps come faster.
- For Step 3, start a 2-player local server from the Test tab and walk one player past the other: you hear their steps from where they are.
Common errors and fixes
If you hear nothing, open the Output window: failed audio and script errors show there.
No footsteps at all
Check FootstepSounds is in ReplicatedStorage with that exact name, that it has at least a Sound named Default with a SoundId, and that Footsteps is a LocalScript in StarterCharacterScripts (not StarterPlayerScripts).
Failed to load sound
The SoundId is wrong, or the audio is private and your game is not allowed to use it. Pick another sound from the Toolbox. See Failed to load sound.
I hear two footstep sounds at once
The default running sound is still playing. Check its name in the Explorer while playing (HumanoidRootPart, then Running) and that muteDefault uses the same name. If you use Step 3, delete the Step 2 script.
Every floor sounds the same
The material is not in GROUPS, so it uses Default, or the group has no Sound with its name. Print humanoid.FloorMaterial to see which material you are on.
Steps keep playing while I stand still on a moving platform
A moving platform gives the character speed. Raise MIN_SPEED, or subtract the platform's own velocity, which you can read from the part under the player.
Build it with RoCode
If you would rather not set this up by hand, RoCode can build it in the place you have open. RoCode is an independent AI agent for Roblox Studio, not made by Roblox: you describe the change in a web chat, and its Studio plugin creates the parts and scripts in your Explorer, so there is no code to paste.
Add footstep sounds that change with the floor: grass, wood, stone and metal, faster when sprinting, a landing thud, and I should hear other players' footsteps too.
- Can read your place first to see which materials your map uses, then groups them for the sounds
- Writes the scripts with Create Script and is told to compile-check each one with Check Script
- Sets an undo point before and after each batch of changes, so Ctrl+Z steps back one batch at a time
Questions
How do I make footstep sounds in Roblox Studio?
Put a LocalScript in StarterCharacterScripts that plays a short Sound every few studs the character walks, and only while humanoid.FloorMaterial is not Air. Step 2 has the full script.
How do I change footstep sounds based on material?
Read humanoid.FloorMaterial and look it up in a table that maps each Enum.Material to a sound group, such as Grass or Wood. Then play the Sound with that name from a folder.
What does Humanoid.FloorMaterial do?
It holds the material of the part or Terrain the character is standing on, and is Enum.Material.Air while the character is in the air.
How do I remove the default Roblox walking sound?
The default running sound is a Sound named Running in the HumanoidRootPart. Set its Volume to 0 from a LocalScript and keep it at 0, as the muteDefault function does.
Should footstep sounds be on the client or the server?
The client. Sounds a LocalScript plays are only heard on that device, which is fine for your own steps. To hear other players, each device plays everyone's steps, as Step 3 does, with no server work.
How do I make footsteps faster when running?
Time the steps by distance walked instead of by seconds. The faster the character moves, the sooner it covers a stride, so the steps speed up on their own.
Sources and further reading
- Roblox Creator Docs: Humanoid. FloorMaterial and StateChanged
- Roblox Creator Docs: Enum.Material. every material name
- Roblox Creator Docs: Sound. PlaybackSpeed, RollOffMaxDistance and Ended
- Roblox Creator Docs: RaycastResult. Material of the hit surface
How the code was checked: every script on this page passes Luau's strict type checker against Roblox's API definitions (luau-lsp, 14 November 2026). A type check catches misspelt APIs and wrong types, not game logic, so playtest in Studio before you publish.