what is the different of world space and local space?

if anyone have an exp

From my understanding World Space is the scene x and y coordinates. So 0,0 of the world coordinates is the very start or center of the scene.

If you create a gameObject and move it 100,100 world coordinates and inside that game Object you create a child object. The childs local coordinates will be 0,0 (i.e. the start or center of that parent object) but it will actually sit at 100,100 in the world coordinates.So if you move that child by +50,+50 it will sit at 50,50 local coordinates but 150,150 world coordinates.

I hope I’m right and clear in my explanation. Maybe a veteran can confirm.

Thanks

EDIT: using 2d as a basic example excluding Z axis and rotation

@ahmedmohsen550, While I’m sure you’re familiar with the Cartesian coordinate system, where in 3 dimensions x is usually left/right, y is usually up/down and z is usually in/out, the “default” or “foundation” of all such measurements, the one reality is bound to (in theory), the universal measurement of all things marked on such a graph is world space.

Now, imagine a table in front of you, or, say, in front of the the camera. It has a location in world space, whatever that may be. On the table imagine a drawing is placed, which itself might be measured. The table’s surface is a reference familiar to everyone, such that looking at the table, viewing this 2d page, you might assume that x is left and right and y is up and down on this 2d page. Yet, this paper is on the table, where in world space y is above the table or below the table, and z, in world space, is truly the direction of the paper’s y coordinate. In this case, the page’s y differs from the world. That is the paper’s local space, or local coordinate system.

In this way, every object in Unity has a position and a rotation which defines its own, private coordinate system. While that object may be at some distance away, with an x of say 5, a y of perhaps 0, but a z of maybe 10, the object has a center or pivot point that defines the center of the object’s rotation, and that’s it’s own, private origin (0,0,0). That center was defined when the object was drawn or created. It is the center in the object’s local space.

Child objects of a GameObject are placed relative to the parent. If the child object’s location is, say, 1, 1, 0, but the parent is way off at 5, 2, -50, the child is still relatively positioned at 1, 1, 0 compared to the parent’s pivot point. The child’s location is 1, 1, 0 in the parent’s local space, but in the world space it’s ultimate location is 6, 3, -50.

This means that in complex layouts in Unity, where there may be children of children of children, there will be many local spaces, one for each object.

This concept isn’t unique to Unity. It is well exampled in math and engineering. It is actually embedded in all of reality, and so Unity’s use of it is an extension of the fact that Unity’s basic purpose is to simulate reality to an imaginary extent.