Local Space vs World Space in Unity

Paul Killman
3 min readJan 4, 2024

--

While working with Unity, it is very easy to confuse local space with world space. In this brief article, hopefully I can explain the difference.

World space is an objects position based upon its place in the world view. Local space is an objects position relative to something else. Here’s an example — in the illustration below, I have a capsule acting as my Player. This capsule has a small cube attached to it as a child so that I know which way the Player is facing.

Player

If I look at the position of the Player, I see that it’s at 10, 1.5, 10. These are World Space coordinates because they describe the Players location in relation to the rest of the world.

If I look at my cube, I see its position is 0, 0.5, 0.5. These are Local Space coordinates because they are describing the cubes position in relation to the Player.

If I were to use World Space coordinates for the cube, they would be 10, 2, 10.5.

Local Space vs World Space can also apply to rotation. You may have noticed that Player also has a camera attached as a child.

If I look at it in the Inspector, I see that it has a position of 0, 1.1, -5.8 and a rotation of -8.4, 0, 0.

Camera Location vs World

I am going to move the Player to 0, 1.5, 0 and rotate it 30 on the X axis.

Player Position and Rotation

You will notice that the cameras position and rotation are unchanged, even though the camera is now in a different position vs the world.

Camera Position and Rotation
Camera Location vs World

There are ways to change between the two types of spaces via script, but that’s a subject for another article.

--

--