Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Parent Game Object to Camera?

$
0
0
I want to parent the game object the script is attached to to the main camera. I have this so far: // Get the transform of the camera var camera = Camera.main.transform; // make it a child of the current object camera.parent = transform; // place it behind the current object camera.localPosition = -Vector3.forward * 5; I know this script does the complete opposite but I don't know what to do from here to parent the game object that the script is attached to to the main camera. Do you know?

Viewing all articles
Browse latest Browse all 171066

Trending Articles



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