Hey Guys, I have made a sort of GTA style radio script, which changes with use of the mouse wheel, thing is, it resets the audio clip and plays from the beginning each time. is there a way to store the duration and come back to it.
I did think about having them all playing from the begining and just controlling the volume, but wouldn’t that be a bit hefty on the processor???
T. Hanks. Steve
By the way, has anyone notices when you’re asking a question. The description of the icons over on the right, are incorrect
#pragma strict
var krose : AudioClip;
var bounce : AudioClip;
var dust : AudioClip;
var PlayBack : AudioClip;
var playing : int = 1;
function Start () {
audio.loop = true;
audio.clip = krose;
audio.Play();
}
function Update () {
if (Input.GetAxis("Mouse ScrollWheel") > 0)
{
playing++;
if(playing >=5){
playing =1;
}
if(playing==1){
audio.clip = krose;
audio.Play();
}
if(playing==2){
audio.clip = bounce;
audio.Play();
}
if(playing==3){
audio.clip = dust;
audio.Play();
}
if(playing==4){
audio.clip = PlayBack;
audio.Play();
}
}
if (Input.GetAxis("Mouse ScrollWheel") < 0)
{
playing--;
if(playing <=0){
playing =4;
}
}
}