Quantcast
Channel: Latest Questions by zeuo
Viewing all articles
Browse latest Browse all 90

how to get the child of an instanteated object

$
0
0
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; } }

Viewing all articles
Browse latest Browse all 90

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>