Parent's transform changed when attaching child
Today something strange happens, when ever I attached a child object to a parent object, the parent transform position tries to snapped the child transform position.
To better illustrate, I am making some kind of guy with a sword by having a capsule as the guy and a smaller and longer capsule for the sword. What happens is that when I attached the sword as the child of the guy (parent) and move the sword a little bit off to the left of the parent. Originally the parent transform is at the center of the larger capsule, but somehow when the child (sword) is added, the parent transform decided to place itself midway between where it use to be and the child, or sometime the parent's transform will be directly the same position as the child, but retain it rotation.
I am using Unity 5, is this a new behavior that I'm might have missed?
Is it changing the vector posicion or just the Guizmos position?
It's probably just changing the Gizmo location. The OP probably hasn't used any modelling software, so doesn't know about the Pivot/Center button.
Answer by Neamtzu · Mar 26, 2015 at 03:55 PM
Most likely you see the transform gizmos from the center of the object. Change it to Pivot to see the real transform position of the parent.
Answer by Digital-Phantom · Mar 26, 2015 at 12:47 PM
if the parent and the child are not exactly in the same space the new position for the parent transform will be midway between the two objects.
:)
This is misleading and wrong. The "position" of the parent doesn't change at all when you add a child. If you have the handle / gizmo mode in the editor set to "center", Unity will draw the handle at the center of the gameobject. However the position of the gameobject doesn't change at all.
I remove the accepted state.
Your answer
![](https://koobas.hobune.stream/wayback/20220613191209im_/https://answers.unity.com/themes/thub/images/avi.jpg)