Skip to content

Footsteps by surface

Level designer · 30 min · No code

Result: characters walking on your new ground type, here snow, play a snow step sound and a puff of snow, and the old grass and stone surfaces keep theirs.

Before you start

  • A step sound (Sound Wave, Sound Cue or MetaSound) and optionally a small Niagara effect for the new surface.
  • Build a world-partition map if you are making a new map.

How a footstep picks its sound

Five links, each set in a different place. A footstep plays only when all five agree.

# Link Where Sample
1 The animation marks each step Anim notifies on the walk and run clips send AnimEffect.Footstep.Walk (and AnimEffect.Footstep.Land on landing) already set up
2 The ground says what it is A physical material with a Surface Type Environment/PM_XenoCore_Grass = Grass
3 The surface type has a name Project Settings › Physics › Physical Surface SurfaceType4 = Grass
4 The name becomes a gameplay tag Project Settings › LyraContextEffects › Surface Type To Context Map SurfaceType4 → SurfaceType.Grass
5 The tag picks the effect A context effects library row: effect tag + context tag → sounds and Niagara ContextEffects/CFX_XenoCore

The character's Lyra Context Effect component traces the ground under the foot, reads its physical material, turns the surface into a tag, and plays whatever the library lists for that step tag + that surface tag. The party pawns use CFX_XenoCore.

Ground with no physical material resolves to SurfaceType.Default, which plays the concrete step.

Steps

1. Add the surface type

  1. Project Settings › Engine › Physics, section Physical Surface.
  2. Fill the next free slot (the shipped project uses 1 to 4; the XenoCore project setup (Install) adds slot 4, Grass, to a buyer's project) with the name Snow. Note the slot number, for example SurfaceType5.

2. Add the tag

  1. Project Settings › Project › Gameplay Tags. Click Add New Gameplay Tag.
  2. Name it SurfaceType.Snow and set Source to DefaultGameplayTags.ini (the project's own tag list), not a plugin's tag file. Click Add New Tag.

Keep surface tags in the project's own tag list

The surface-to-tag map is read very early, when the game's settings load. A tag defined in a plugin's tag file may not exist yet at that moment, so the mapping silently points at nothing and the surface falls back to the default step.

3. Map the surface type to the tag

  1. Project Settings › Game › LyraContextEffects.
  2. In Surface Type To Context Map, add SurfaceType5 (it shows as Snow) → SurfaceType.Snow.

4. Make the physical material

  1. In the Content Browser, open MyGame/Environment, right-click, and choose Physics › Physical Material (class PhysicalMaterial). Name it PM_Snow.
  2. Set its Surface Type to Snow.

5. Put it on the ground

Choose the one that matches your ground:

  • A landscape: select the Landscape actor and set Default Phys Material to PM_Snow. That covers the whole landscape unless its material outputs a physical material per paint layer.
  • A material used by meshes: open the material and set Phys Material in its Details.
  • One static mesh: open it in the Static Mesh editor and set Collision › Simple Collision Physical Material.

Fails silently: a landscape with no physical material sounds like concrete

A landscape without Default Phys Material resolves every step to the default surface, which is mapped to the concrete sound. Nothing warns. Any new map's landscape needs this field.

6. Add the effect rows

Rather than editing XenoCore's library, give the characters a library of your own:

  1. In the Content Browser, open MyGame/Audio, right-click, and choose Data › Data Asset. Pick the class Lyra Context Effects Library and name it CFX_MyGame.
  2. Add two entries to Context Effects:

    Effect Tag Context Effects
    AnimEffect.Footstep.Walk SurfaceType.Snow your step sound, your Niagara puff
    AnimEffect.Footstep.Land SurfaceType.Snow your landing sound
  3. Add CFX_MyGame to the characters. Open Game/B_XenoCore_PlayableCharacter_Base and Characters/Party/B_XenoCore_PartyMember_Base. On each, select the LyraContextEffect component and add CFX_MyGame to Default Context Effects Libraries. Compile and Save both.

Both pawn bases need it: the player's pawn and the party members are built on different bases. The VRoid party members (Characters/VRoid/B_XenoCore_Party_VRoid_Base and its children) are children of B_XenoCore_PartyMember_Base, so they inherit it. (On the party base the LyraContextEffect component comes from its C++ parent, so it shows as inherited; the library list you set on the Blueprint is still what the members use.) Libraries add up rather than one winning: a step plays every matching row from every library in the list.

Or add rows to CFX_XenoCore

Adding the two rows to ContextEffects/CFX_XenoCore also works and touches one asset instead of three. It is a shipped asset, so a template update may overwrite it.

Test it

  1. Place a flat mesh or paint an area that uses PM_Snow in Maps/L_XenoCore_Gym or your map.
  2. Play and walk from the normal floor onto it. The step sound changes to yours, and your puff appears under each foot.
  3. Jump and land on it. The landing sound is yours.
  4. Walk back onto grass or stone. Their sounds are unchanged.

If it doesn't work

Still the concrete step

The ground has no physical material, or the physical material's Surface Type is still Default. Check the landscape's Default Phys Material first.

Silence on the new surface

The surface resolved to SurfaceType.Snow, but no library row matches. Check the row's Effect Tag is exactly AnimEffect.Footstep.Walk and its Context is exactly SurfaceType.Snow, and that CFX_MyGame is on the pawn you are playing.

Works for the leader, not for party members

The library is on only one of the two pawn bases.

Going further