Footsteps in Unity3D

This is footsteps sounds testing area where you can walk on various surfaces and hear different versions of sound.

The footstep sound set is determined by collision with terrain and objects. The footsteps script examines whether the Player is walking on the Terrain or the other object. If  Terrain is detected under the Player’s foot version of the footsteps is determined by examining Terrain Texture.

Because Terrain Textures can me mixed and scattered there is kind of ‘sound antialiasing’ applied (not in the literal sense). This is done by mixing recently played footstep sound type with the new one. Volume of the old one is decreased to some degree (~50%). This alleviate a little an unpleasant effect of quick switching between sets of footsteps – especially when single footstep of the whole set is played and then switched to another. This helps the Player to percieve background sound as nicely blended and less discrete (binary 0/1). You can test the difference of ‘footsteps antialiasing‘ by switching it off or on using ‘E’ key. By default it is turned on.

Footsteps are shuffled and tempo of steps is based on Players speed.

There are two areas where you can hear a reverb on footsteps. One is achieved with Unity3ds Reverb Zone. The second one uses stereo samples with mixed prerendered Reverb. The second  solution takes much more memory than the first one because of stereo sound and long reverb tails.

Controls: WASD + Mouse and left shift to run. It doesn’t work in Chromium based browsers anymore (Chrome, Opera) so you have to use Firefox or else.
Update info (06.2017): due to policy changes and lack of updates on Unity side, online example seems not to work in any of current browsers. Sorry.

One thought on “Footsteps in Unity3D”

Leave a Reply