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

Why Deparenting The First Child Changes Position of The Parent

$
0
0
I have three balls attached to a parent. When they hit an obstacle, I destroy the balls. However, when the first child of the parent is destroyed, the parent's position changes - its y value changes. Then another ball becomes the first child and the same thing happens. When the destroyed ball is not the first child, then the parent's location does not change at all. This seemed weird to me. How can I solve this? Can I disable recalculation of parent's new position after deparenting? - I use the below lines. After 1 second, I destroy the ball. gameObject.transform.SetParent(null); transform.localScale = new Vector3(0, 0, 0);

Viewing all articles
Browse latest Browse all 302

Trending Articles



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