Volume control in Unity

Hi,

I have created a volume control slider for my game but when I move the slider, it becomes completely quite instead of gradually decreasing. I placed the Audio Listener and Audio Source in the Canvas object. I have included my control script below.

public void volumeControl(float controller)

{

AudioListener.volume = controller;

}

Thank you.

What kind of values are you passing to the method? AudioListener.volume should be between 0 and 1.