Putting an object as a child to an empty gameObject resets parent position

I have 1 cube which I want to make a child to an empty gameobject which is at a different position on my grid. As soon as I drag the cube onto the empty gameobject as a child the empty gameObject (now parent) jumps its grid position to that of the child’s

This only happens with an empty gameobject. If I drag the empty game object onto the cube as a child the parent does not lose its grid position. If I have more than 1 cube and drag them BOTH onto the empty game object then the parent empty game object also doesn’t lose its position.

What is the logic behind this?

Parenting and unparenting gameobjects can have really weird effects, changing the position, scale, rotation all sorts of weird crap. It seems like you have to control what happens afterwards.

This is also happening on Unity 5 on my laptop. So this is more than a bug, I must be doing something wrong?

I figured it out. I had ticked the ‘centre’ button on the pivot point rather than ‘Pivot’ meaning it was centering between the two game objects, or (weirdly) just placing it dead centre of the child gameobject.

3 Likes