Hello,
I am attempting to change the volume when the player is walking to be much more quiet...
I reference the Sound script from the Sound child object I have on the player, then tried changing The footsteps script to add this:
soundScript = KickStarter.player.transform.Find("Sound child").GetComponent<Sound>();
for running:
soundScript.SetVolume(setRunVol); // float
when walking:
soundScript.SetVolume(setWalkVol); // float
However seems to have no effect,
Could you help me out? I do not want to tamper with any sound volumes in general, only specifically adjusting when running/walking on their component.
Perhaps this can be added to a future AC update, to have the options to change the Walk/Run volumes?
Thank you
Comments
You want to instead change the relative volume setting, which allows for the sound to be a factor of the SFX volume:
soundScript.ChangeRelativeVolume (setWalkVol); // This should be between 0 and 1
Also know that alternatively you can rely on Unity's Audio Mixer Groups feature. See the "Sounds" Manual chapter for details on how to switch to Mixer Groups for sound control, and you can then create a child-mixer for your Footstep AudioSources that can then be controlled with the Sound: Set mixer snapshot Action.
I shall look into that, as for the moment the quick fix works like a charm.