Different levels of volume for footsteps.

In my game the player shrinks and grows at different times depending on game play. I am getting around to work on the audio system with the footsteps and am using the Body Step mode and it is working for what I need now, I might look at setting up the trigger system in stead, read on another forum post Justin recommended that, but for now Body Step mode. What I am wanting is as the player shrinks/grows the footsteps get softer or louder. I have made a surface effect foot step and have different audio files to choose from but how can unity change this based on the player scale? Thanks!
 
With a body step the audio source used is on the character itself. In both cases - triggers and the body step - you will need to manage the audio level yourself through a separate script. There isn't anything built in to handle this. The surface system does not allow you to manage the audio level in this way.
 
Is there anyway to change the volume of a surfaceeffect through script? Can you put an example code of that if there is?
 
Hey, not a single script is required here, the State System and Audio Configs are your friends ! Here's what I did in my own game for softer footstep sounds when crouching :

Capture d’écran (3082).png

Capture d’écran (3083).png

You just need to have a state named something like "Small" for when your character is shrinking. Lemme know if this works for you.
 
Thanks @Cheo! For discrete values you can definitely use the state system, but I was thinking that you'd want more continuous values and with that you will need to create your own script.
 
Ill keep looking at this, but yeah I have several other states setup with camera it adjusts with char height with the state system. What I was thinking was if I had a way to just have 10 surface effect assets varying on the scale 10 percent 20 30 etc and then where my script is already swapping clothes due to size changing it could just load the correct sound asset?
 
Top