Quantcast
Channel: Questions in topic: "parenting"
Viewing all articles
Browse latest Browse all 302

How to fix components turn off when unparenting an object?

$
0
0
I am having weird behavior in my game where whenever I unparent a child, all of the child's components are turned off. I am trying to unparent the child just before destroying the parent. Any help with this issue would be greatly appreciated. int i; for (i = 0; i < this.transform.childCount; i++) { if (this.transform.GetChild(i).transform.tag == "Satellite") { Debug.Log("Unparented " + this.transform.GetChild(i).name); this.transform.GetChild(i).parent = null; } } Destroy(this); } Here is my code for reference.

Viewing all articles
Browse latest Browse all 302

Trending Articles



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