i have a rocket that i create and there is a camera inside of it i want to be able to enable and disable that camera
if (GUI.Button(Rect(450,280,80,80),"Rockets"))
{
var bullit = Instantiate(rocketpref, GameObject.Find("rs").transform.position, Quaternion.identity);
}
if (GUI.Button(Rect(350,280,80,80),"cam"))
{
var newcam = bullit.Find("rocket/Camera").camera;
//var child = GameObject.Find("/Camera").camera;
if(newcam){ print("found");}
//newcam.depth=1;
}
}
↧