I have two objects in inspector, which both positions don't match if they were to share the same position

Scale excluded.

I just came across this today and either my brain is dead today or my brain is dead today.

So I have 2 objects, a wall and the Player cube. The NorthWall.transform.position.z = 0.5, while if I were to move my Player.transform.position.z = 0.5, they don’t match.

I checked whether it was a scale-related thing so I scaled my cube down to the same size, but it still doesn’t match. I swear I’m missing something obvious.

Extra info: Unity3D - What I’m trying to do is: When the player surpasses the z transform, set the Player.transform.position.z to it (restricting movement withint he black area).


It’s because the objects are under different parent transforms. Unity only shows the local position of the object (relative to its parent transform) in the inspector. Give them the same parent and their positions should match if they are in the same spot.