World Space vs Local Space

World Space

  • World Space refers to the global coordinate system in Unity, which is the same for all objects in the scene. This coordinate system is fixed and does not change based on the object’s position or orientation.
  • When you move, rotate, or scale an object in World Space, you are doing so relative to the global origin point (0,0,0) of the entire scene.

Local Space

Unparented Object’s Local Space
Parented Object’s Local Space
  • Local Space refers to the coordinate system that is relative to the object itself. Each object has its own Local Space based on its position, rotation, and scale.
  • If the object is Parented, the Local Space is calculated based on its Parent’s position, rotation and scale.
  • When you move, rotate, or scale an object in Local Space, you are doing so relative to the object’s own origin (or the origin of its parent), which can vary depending on the object’s current transformation.
  • Example: If a child object has a position of (0, 0, 0) in Local Space, it will be placed at the origin point of its parent object, not necessarily the global origin of the scene.

Practical Example in Unity

  • World Space: Imagine you have a character in a game at position (5, 0, 2) in World Space. If you want to move this character to another point in the scene, you’ll change its position relative to the scene’s global coordinates.
  • Local Space: Now, if that character is holding a sword, the sword’s position might be set to (1, 0, 0) in Local Space, meaning it’s 1 unit in front of the character’s local origin. If you move the character, the sword will move with it because its position is relative to the character’s local space, not the world.

Why It Matters

  • World Space is useful when positioning or animating objects that need to interact with the entire scene (e.g., a camera following a player across a map).
  • Local Space is useful when you need objects to maintain their position relative to a parent object (e.g., a weapon held by a character).

1 thought on “World Space vs Local Space”

  1. Pingback: 1st Interaction – Earth Artwork – MyInteractionKit

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top