Quantcast
Channel: Answers for "How do I center a GameObject on its children?"
Browsing latest articles
Browse All 8 View Live

Answer by m50

You can try removing the parent of the child, set the position of the main object to its child, then reparenting

View Article



Answer by era

You could save the current combined position of the children in a var, then center the children to the parent (maybe using transform.localPosition or whatever suits your specific need), and then move...

View Article

Answer by Joe Wreschnig

If you are trying to move the parent relative to the children, it sounds like you may have your parent/child relationship backwards or sideways. What benefits is the parent/child relationship getting...

View Article

Answer by Horsman

Sum the transform.position of all of the children, then, divide that by the count of the children. This is the centered position. Set each of the children's parent to null, then move the parent object...

View Article
Browsing latest articles
Browse All 8 View Live




Latest Images