Surfaces and the Surface Library

Surfaces #

A Surface (Assets > Create > Responsive FX > Surface) is one kind of ground: Wood, Grass, Metal, your own "Squeaky Floorboards". It holds:

Setting What it does
Display Name, Colour Shown in the debugger, gizmos and Scene Overview.
Keywords Words that find this surface in material, texture, terrain layer, tile and object names (grass, lawn, turf).
Walk, Run, Crouch, Jump, Land A sound set each. Run, Crouch and Land fall back to Walk when empty; Jump plays nothing when empty.
Volume Volume of everything on this surface.
Step Effect, Land Effect Optional prefabs (dust, splashes), pooled.
Footprints, Footprint Colour Whether this surface keeps footprints, and their colour (dark mud, pale snow).
Loudness How loud steps here are to AI: 0.5 soft grass, 1.5 clanging metal, 0 silent to AI.

Each sound set picks one clip at random, never the same one twice in a row, with a little random volume and pitch. The surface inspector has Walk, Run and Land buttons to listen without pressing Play.

Your own sounds in one click #

Select your footstep clips (or a whole folder of them) in the Project window and choose Assets > Responsive FX > Make Surface From Selected Clips. It makes a new surface in Assets/RareGeometryData/ResponsiveFX/Surfaces:

  • Clips with run, sprint or jog in their name go to Run, crouch or sneak to Crouch, jump to Jump and land to Land; everything else is a walk step.
  • The surface is named after the word the clip names share ("Gravel_Step_01", "Gravel_Run_02" makes "Gravel"), and that word becomes its keyword, so materials called "Gravel..." find it straight away.
  • It's added to your own Surface Library if you have one. Your clips aren't moved or changed.

You can also drag many clips at once onto any sound list in a surface's inspector.

Sounds included #

The sample library has 13 surfaces and more than 200 sounds, CC0 recordings plus a few of our own (see Third-Party Notices.txt): Wood, Stone, Grass, Gravel, Dirt, Mud, Sand, Leaves, Metal, Water, Carpet, Snow and Ice, with landing sounds for the soft surfaces, wood, metal and water. There are also gear sounds a character can add to every step (Leather, Cloth, Plate Armour, Armour Jingle) and a Robot Feet surface to force on a robot. Make your own copy (Setup Wizard) before changing them.

The Surface Library #

A Surface Library (Create > Responsive FX > Surface Library) lists your surfaces and how to recognise them. Given what a foot touched, it checks in this order and stops at the first answer:

  1. A Surface Zone the foot is inside (water, a rug). See Zones.
  2. A Surface Tag on the object or a parent: the surest way to say "this is Metal".
  3. Another tool's surface tag: any component with a public text property called SurfaceName that names a surface here (a level builder's Surface Tag works this way, no setup).
  4. A terrain layer under the foot (with Blend Two, the second layer joins in quieter where they mix).
  5. A tile on a 2D tilemap.
  6. A rule for the collider's physics material, the renderer's material (the right one on multi-material meshes), or its main picture.
  7. A surface keyword in those names ("M_Lawn_02" contains "lawn").
  8. A Unity tag rule.
  9. A keyword in the object's name (and its two parents).
  10. The Default Surface, so a step is never silent by accident. Leave it empty if unknown ground should be silent.

Answers are remembered per collider, so after the first step on an object it costs nothing. Terrains and tilemaps are looked up per step, still with no garbage.

Rules are written for you by the Setup Wizard, Scene Overview and the debugger's fix buttons. You can also edit the lists in the library's inspector.

Tips #

  • Already have physics materials per ground? Map those once and every object using them is covered.
  • Painted terrain at runtime? Call library.RefreshTerrain(terrainData).
  • Changed a material from code? Call SurfaceCacheVersion.Bump().

Something unclear or wrong? Tell us · Get help