- Home /
Question by
Smujukia · May 03, 2019 at 05:44 AM ·
audioaudiosourceparameterscondition
How to change audio parameters with script?
Hi, I'd like to change some exposed audio parameters on conditions.
First: If the player is on the right side of the screen, increase the flange rate. (I tried to do this here, and it's not working, please take a look!)
Second: If the player hits something, increase flange depth by x for x amount of seconds.
Please help! I appreciate it. :)
public AudioMixer audioMixer;
public LevelManager LMScript;
public void SetFlangeLevel(float FlangeRate)
{
if (LMScript.PlayerIsOnTheRight)
{
//increase Flange
audioMixer.SetFloat("FlangeRate", 10);
}
}
Comment
Hey @Smujukia, I don't think there is nothing wrong in the code. Please check if the exposed parameter has the same case as used in the code. I learned from this video, hope this helps https://www.youtube.com/watch?v=YOaYQrN1oYQ