- Home /
Urgent! Need to animate volume
Hi, I really need to know this like, yesterday, so if you could help me out I'd be very grateful.
I need to alter volume of my scene. It needs to be silent for 10 seconds at the start and then go to full volume. I have created a master volume control with the following code :
var master = 0;
function Update () {
AudioListener.volume = master;
}
I need to be able to change this from 0 to 1 after 10 seconds of the scene loading. However I cannot seem to animate the variable "master" so I am stuck. I'm sure this is easy but I have tried several ways and I have not worked it out.
Please help
Thankyou
Please remove "urgent" from your question title. Everyones question is urgent. This is an nonepolite way of asking us for free help.
Answer by Mike 3 · May 05, 2010 at 09:30 PM
function Start() { Invoke("ChangeVolume", 10); }
function ChangeVolume() { AudioListener.volume = 1; }
that is the simplest way really - if you want it to gradually fade in after the 10s silence, it's a bit more code