Question by
NewYorkHOK · Oct 25, 2017 at 05:48 PM ·
c#scripting problemvrparent
How do I unparent a child object with C#? For Google VR
I have a game object (flat menu) that is child to a parent object (Camera). The menu follows that camera but I would like to onClick to unparent the child so that it does not follow the parent any longer. and thus could use a recticle to click button on the menu.
Thanks for any help!!!! Best, Adam
Comment
Answer by Cuttlas-U · Oct 26, 2017 at 05:53 AM
hi; u can make its parent to null;
yourObjectRefrence.transform.SetParent(null);
or u can make all the camera child to detech;
CameraObject.transform.DetachChildren();