This works by adding a new FootstepController.cs script onto the Player prefab. I modified the player controller to perform a raycast downwards when we are moving in order to detect the tag of any gameobjects on the "Floor" layer directly below the player. This raycast will dispatch a call to FootstepController.cs to attempt to play a sound with the cooresponding raycast hit object's tag.
Stipulations:
You must add walkable floors to the "Floor" layer, or else a sound will not play
You must add a tag corresponding to the material of the floor onto the object, or else the FootstepController will play a concrete noise (default fallback)
https://github.com/user-attachments/assets/42ab9804-aff0-4dfa-9e6c-44393e2fa890
This works by adding a new
FootstepController.cs
script onto the Player prefab. I modified the player controller to perform a raycast downwards when we are moving in order to detect the tag of any gameobjects on the "Floor" layer directly below the player. This raycast will dispatch a call toFootstepController.cs
to attempt to play a sound with the cooresponding raycast hit object's tag.Stipulations: