Transform position differences between Unity 4.6.6f2 vs. Unity 5.1.1f1

This seems like such a huge bug I am pretty sure I am doing something wrong.
Please explain why and what is causing this basic difference.

Repro steps:

  1. Create an empty game object at 0,0,0.
  2. Duplicate it and move it to be the child of the previous object. (Rename it.)
  3. Set the Y coordinate of the child from 0 to 5.
  4. Now click between the two, selecting one then the other and observe that the transform gizmo jumps up and down from 0,0,0 to 0,7,0 as you select the parent at 0,0,0 or the child at 0,7,0.
    All OK so far. (both in Unity 4.6.6f2 and Unity 5.1.1f1)
  5. Now add a Box Collider component to the CHILD object.

BUG???
6. Now click between the two, selecting the parent then the child and observe that the transform gizmo jumps up and down from 0,0,0 to 0,7,0 as you select the parent at 0,0,0 or the child at 0,7,0. IN UNITY 4
BUT NOT IN UNITY 5. In Unity 5 it is now stuck at the position of the child, no matter which object is selected.
Why is there this basic difference? Why does this work in Unity 4 and why is it broken??? in Unity5?

Note:

  1. If I add the box collider ONLY to the parent then all is OK in both versions of Unity: the transform gizmo shows their position correctly when clicking between them.
  2. But if I also add a box collider to the parent and the child, then in Unity4 the gizmo still jumps to their positions correctly when clicking between them, but in Unity 5 when selecting the child the gizmo shows the correct location, but in case of selecting the parent the gizmo now jump half way between the 2.
    ???

Please help to figure this out.
I updated my project from Unity 4 to 5 and I am now stuck because of this bug???, difference.

Thanks in advance,
Emese

Please somebody try this out on your version of Unity, it takes like 20 seconds.
I have tried it on Windows 64 bit Unity 5.1.1f1 and on Mac with Unity 5.1.2f1. Both show the bug.

It is not just the manipulate gizmo showing the position of the child incorrectly but scripts use that incorrect position too: I am spawning objects to the position of the child object, but they are not created at it’s transform’s coordinates but at the parents coordinates.

Why is there this fundamental difference between Unity 4 and 5?

Thanks in advance,
Emese

Works for me…
On the top of the viewport is a button “center”. Click on it and it will change to “pivot”.
That should paint the gizmos that you want.

It should not change the way scripting works. If you get the wrong position, maybe your code is wrong.

Oh well, that was stupid. :slight_smile:
Thank you very much Carpe for pointing that out.

Off to find what else is causing my bugs…

Br,
Emese

Do you have an example for your scripting problems?

The pivot suggestion is a work around not a solution. When centre is clicked it should be on the centre of the object NOT between 0,0,0 and the object’s actual position. This is still an issue in 5.3.1. Apart from anything else it makes editing a pain when you press F to focus on your object and it’s zoomed out really far because the object some distance from 0,0,0

I’ve seen no differences, if there were it would dramatically break a lot of projects.

Are you getting the position via position or localPosition? ( they would actually be the same if your parent is at 0,0,0)

Just checked in 4 vs 5. There is one difference, 5 will fully zoom on the parent object when you focus(f) if you have pivot mode selected. So that is actually an improvement.

Otherwise the functionality is pretty much the same.
Center and Pivot in 4: f will focus on the combined (bounds) center.
Center on 5 : f will focus on the combined (bounds) center.
Pivot on 5 : f will focus on the parent’s pivot.

ff (shift f) will focus and follow on the parent in both.

Since this happened I deleted the colliders that seemed to cause the issue. They are gone from the inspector but when the parent is highlighted they are still present on the object in scene view. I dont know if this is causing any real major issues.
It seems to be just a bit of an inconvenience. Ive just done a few positioning tests and they worked fine. That said I hope the big guys are aware of this because even small issues can have a big impact on time spent and I already find there aren’t enough hours in the day as it is. :slight_smile:

Not sure there is really an issue. More than likely there is a script that is affecting things or just the way you have things set. But if you believe there is a problem, submit a bug report with your scene attached so they can look at it. That is best way to ensure their attention is called to it there is a legitimate engine bug.