Why gameObj's pos changes when a child is added ?

Screenshot by Lightshot -1st screenshot

Screenshot by Lightshot -2nd screenshot

Screenshot by Lightshot -3rd screenshot

Screenshot by Lightshot -4th screenshot

Screenshot by Lightshot -5th screenshot

GameObject’s position is 000 all the time but when a child being added to it, it changes its position somehow as if it was the child not the parent and it’s 000 pos becomes in the center of the PlatformLongest gameObject not in the center of the screen. To see this you can just switch fast between the 1st and the 3rd screenshot.

Also when I add another gameObj to the parent (PlatformShort in this case) the parent gameObj’s position goes between the 2 children positiion. You can see this by switching between the 4th and the 5th screenshot.

Please if anybody can help me… it doesn’t look like something very buggy just probably I don’t understand how it works.

The actual position isn’t changing. You can even see that it’s always (0,0,0) in the Inspector. The editor is just trying to be helpful by moving the handles to the center of the object, just to make it easier to find.

See the small button in the upperish left that says “Center”, next to “Local”? If you click it to “Pivot” the handles will stay at the actual position. Of course, it has no effect on game play.

GameObject is an empty game object. Since it has only one child, it’s position will be the center of that child. If it has two or more children, a bounds encapsulating all of them is created, and the position of the parent object will be the center of that bounds.