Hello all,
My scene have a sound background attach to Main Camera, and I want turn it on/off follow hide/unhide of a Plane(play sound if Plane hide, and stop sound if Plane visible). My code run ok but audio error (bumble):
public GameObject Plane;
void OnGUI () {
if(Plane.activeSelf)
{
Camera.main.audio.Stop();
}else{
Camera.main.audio.Play();
}
}
What can i do to fix this error?
Thanks.