- Home /
movie audio not functioning
I am working on kind of cut scene manager. I have for different images representing buttons to click on and when they click on a image, the corresponding movie will play. The actual movies work great, the problem is the audio, the audio tied to the movies will not play when the button is clicked, but for some reason will start to play when someone exits the trigger that makes the manager pop up. Of course this is within an OnGui function.
if(movieMenu)
{ GUI.Box(Rect(0,0,Screen.width,Screen.height),"MovieGallery",GUI.skin.GetStyle("movieMain"));
if(GUI.Button(Rect(150,250,200,200),"",GUI.skin.GetStyle("screen1")))
{
playMovie1 = true;
}
if(GUI.Button(Rect(400,250,200,200),"",GUI.skin.GetStyle("screen2"))) { playMovie2 = true; }
if(GUI.Button(Rect(650,250,200,200),"",GUI.skin.GetStyle("screen3"))) { playMovie3 = true; }
if(GUI.Button(Rect(900,250,200,200),"",GUI.skin.GetStyle("screen4"))) { playMovie4 = true; }
}
if(playMovie1) { GUI.skin = null; GUI.Box(Rect(0,0,Screen.width,Screen.height),””); Debug.Log("play movie 1"); renderer.material.mainTexture = movie1; movie1.Play(); audio.clip = audioclip1; audio.Play();
}
if(playMovie2) { GUI.skin = null; GUI.Box(Rect(0,0,Screen.width,Screen.height),””,movie2); Debug.Log("play movie 2"); //renderer.material.mainTexture = movie2; //movie2.Play(); audio.clip = audioclip2; audio.Play();
}
if(playMovie3) { GUI.skin = null; GUI.Box(Rect(0,0,Screen.width,Screen.height),””); Debug.Log("play movie 3"); renderer.material.mainTexture = movie3; movie3.Play(); audio.clip = audioclip3; audio.Play();
}
if(playMovie4) { GUI.skin = null; GUI.Box(Rect(0,0,Screen.width,Screen.height),””); Debug.Log("play movie 4"); renderer.material.mainTexture = movie4; movie4.Play(); audio.clip = audioclip4; audio.Play();
} }
Your answer
Follow this Question
Related Questions
Play sound on button click before loading level. 3 Answers
Help With GUI Stop and play other Sound ? 1 Answer
Audio preferance saving why isn't it working? 0 Answers
SOS. Box collider trigger for audio 1 Answer
Fast forward an audio clip 1 Answer