Documentation

Thank you so much for purchasing Advanced Footstep System.


  • Author: killereks#0960

If you have any questions that are beyond the scope of this help file, Please feel free to contact me via discord.


Installation

Follow the steps below to setup your footstep system:

  1. In Unity go to Assets > Import Package > Custom Package
  2. Select the FootstepSystem.unitypackage and import it
  3. In your scene add a new GameObject and add the FootstepSoundManager component to it.

Adding Sound Groups

Here you can edit your sound groups. An example of a sound group is "Grass" or "Wood".

Simply type the sound group name and add it.


Assigning Sounds

  1. List of sound groups which you can select.
  2. List of layers which you can select.
  3. If you want to drag custom sounds, drag the sounds into this area.
  4. For automatic sound assignment, type in the sound name into the box, for example "Wood" and click one of the apply sounds button. This will find all clips with the text "Wood" and assign them.


Layers

Layers allow you to have different footstep sounds for the same ground type, depending on the circumstance.

Example 1: You have a player and an alien, on concrete player will make stomping sounds but the alien would have "barefoot" sounds. Alien layer would have barefoot sounds, whereas player would have the layer "Player".

Example 2: Player can take off his shoes at any time making his sounds different, with shoes player has layer "Player_Shoes" but upon taking them off he has layer "Player_Barefoot".

Changing Layer during run time

// to change layer:
FootstepEntity fEntity;

void ChangeLayer(){
	// make sure this is spelt exactly like the name given
	fEntity.currentLayer = "Player_Barefoot";
}

Default Settings Tab

Default Audio Mixer is used for the volume group.

Create an Audio Mixer in the Assets folder (Right Click > Create > Audio Mixer)

Create an audio group in the audio mixer and name it "Footsteps"

Now back in the Footstep Sound Manager assign it, then you need to click the "Assign to all footsteps" button for it to take effect.

Newly added footstep entities won't have the audio mixer assigned by default, you need to click the "Assign to all" in order for new entities to have that audio mixer.

You can also set the default footstep tag which will be used when an object does not have a Ground Identifier assigned.


Main Settings

The audio source is the target audio source for the footstep sounds, this can be automatically created when "Add Audio Source" is clicked. This will also automatically apply 3D settings.

Ray offset is the offset for the feet, the red sphere should be positioned where you want the player to detect ground change. For better accuracy you could even use 2x footstep entity (one for each foot).

Distance is the ray distance, increase it enough for the red sphere to appear (but don't make it too large).

3D sound preset will automatically apply settings to the above assigned audio source. It changes:

  • Spatial Blend to 3D
  • Doppler level to 0
  • Spread to 60
  • Turns off "Play on Awake"


Layers

Here you can set the layer for the entity. Layers are further explained here


Events

Events are useful if you want footsteps to drive some code logic.

Example: Enemies will hear player's footsteps if close enough, use "OnFootstepSoundPlayed".

Example: When player walks into mud he gets slowed down, use "OnGroundChanged" where second argument is "Mud".


Playing Sounds

There are two main ways of playing the footstep sound, depending on what your scenario is.

First Person Character


FootstepEntity fEntity;

void PlaySound(){
	// run this command to play the sound.
	fEntity.PlayFootstepSound();
}

Here is an example on how you can use it in a first person game.


FootstepEntity fEntity; // our footstep entity component

float footstepTimer; // keep track of the time until next sound
[SerializeField] float footstepFrequency = 7f; // means 7 m/s gives 1 sound per second

Rigidbody rb; // rigidbody or character controller, whatever you're using

void Update(){
	footstepTimer += rb.velocity.magnitude;
	
	if (footstepTimer >= footstepFrequency){
		footstepTimer = 0f;
		fEntity.PlayFootstepSound();
	}
}

Third Person Character / NPCs

Go to the animation import settings.
  1. Move the slider until there is a footstep in the animation.
  2. Add an animation event
  3. Add the function "PlayFootstepSound" (Case Sensitive!)

Make sure that the FootstepEntity is on the same object as the animator that is playing that animation.


Tags

After adding your tags in the FootstepSoundManager you will see them appear in the GroundIdentifier, simplify assign this component to anything that player can walk on and setup the correct tags for each object. (It's very easy if you have prefabs).


Common Errors

This error means you didn't set the default tag in the FootstepSoundManager. It also means that GroundIdentifier is missing.

If you have any questions, or suggestions you can either post them on itch.io or contact me directly on discord

  • killereks#0960