Eonevolve Learning
Unity and DevelopmentUnity and codeBeginner~5 min

Transform and Space: Parent, Child, Local vs World

Snapshot

~70 sec

Every Transform has two honest answers to "where am I": local position, relative to its parent, and world position, relative to the whole scene. Reading the wrong one is the single most common source of "my object jumped" bugs.

You will learn

  • Distinguish local position from world position for a parented object.
  • Predict what happens to a child's world position when its parent moves.
  • Recognize the bug pattern caused by reading local position as if it were world position.

Target outcome

You can explain why a child object's numbers change even though nothing touched that child directly.

Visual walkthrough

Visual walkthrough

~5 min

  1. Four terms that stop the confusion

    • Local position

      An object's position relative to its own parent. Zero means "exactly at the parent's origin."

    • World position

      An object's position relative to the whole scene, regardless of parenting.

    • Local scale

      An object's scale relative to its parent - parent scale multiplies into it.

    • Re-parenting

      Moving an object to a new parent in the hierarchy, which can change its local values while keeping world position fixed (or vice versa).

  2. Reading local versus world for the same child

    ApproachWhat the number meansChanges when...Use it for
    transform.localPositionOffset from the parent's Transform."I sit this far from my parent."You move this object relative to its own parent.Placing UI elements or attached parts consistently under a parent.
    transform.positionAbsolute position in the scene."I am here in the whole level."You move this object, OR any ancestor above it moves.Physics checks, distance comparisons, spawn points, anything scene-wide.
  3. Explain the jump

    A UI health icon is parented under the player. Its localPosition never changes in your script, but its world position moves every frame during play. Is this a bug?

    Expected reasoning

    No. localPosition staying constant is expected - it means the icon keeps the same offset from the player. Its world position moves because the parent (the player) is moving; the child inherits that motion automatically. That is exactly what parenting is for.

Go deeper