Quantcast
Channel: Latest Questions by quenhoai2003
Viewing all articles
Browse latest Browse all 20

Turn camera's sound on/off follow other Gameobject

$
0
0
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.

Viewing all articles
Browse latest Browse all 20

Latest Images

Trending Articles





Latest Images