World position values are not correct (Is this a script problem?)

I’ve run into a problem.

In the image I provided, 1 and 2 represent different areas. They are contained in an empty GameObject, and everything in the level is contained in that object. The GameObjects labeled 1 and 2 have normal positions in the world, but the objects contained inside them do not. They have absurdly large values like X:-19283274, Y:-3001.2. When I remove the objects, they appear to reset to normal values, but this will impede my project as it will be extremely cluttered and unorganized.

TL;DR Why do these values tend towards such large numbers (could it be a script conflict) and is there an easy way to organize these objects together while still keeping their normal world positions via editor or script? Anything helps, thank you.

I can’t see your hierarchy, but are you sure you’re not looking at world vs local position? If your empty gameobjects are in odd positions and you move a child under them, you should be seeing the local position on them based on where the empty gameobject is at.

Is your parent object a RectTransform? If that the case the positions are expressed in the canvas space, which units are usually in pixels.

This seems correct, but is there any way to display the world position in the Transform instead of the local position? It would be a lot more efficient for myself.

I’m not aware of there being a way to show world instead of local. There may be some custom editor scripts that would do that.

I’ve been meaning to try writing something to do that.

[CustomEditor(typeof(Transform))]
public class UI_TransformGUI : Editor
{
    public override void OnInspectorGUI()
    {
        Transform t = target as Transform;
        Vector3 localPos = t.localPosition;
        Vector3 newLocal = EditorGUILayout.Vector3Field("Local Position", localPos);
        if(newLocal != localPos)
        {
            t.localPosition = newLocal;
            Repaint();
        }
        Vector3 newWorld = EditorGUILayout.Vector3Field("World Position", t.position);
        if(newWorld != t.position)
        {
            t.position = newWorld;
            Repaint();
        }
    }
}

I also tried the newer serialization-based approach (if anyone is interested in trying that, the transform serializes to values with names like “m_LocalPosition” and “m_LocalRotation”) but had weird dependency problems. (That approach would let you retain multi-component editing so it might be worth figuring out.)