Skip to content

t1k:unity:base:pivot-hierarchy

FieldValue
Modulebase
Version2.2.2
Effortmedium
Tools

Keywords: hierarchy, pivot, transform, unity

/t1k:unity:base:pivot-hierarchy

Guide for the “empty parent + offset child” hierarchy pattern. Applies to pivot fixing, rotation pivots, orbits, attachment sockets, animation isolation, and DOTS ECS baking.

Scope: GameObject hierarchy restructuring for pivot control. Does NOT cover animation rigging, IK solvers, or physics joints.

  1. Create empty parent GO at logical position (feet, rotation center, socket)
  2. Add child GO with mesh/visual at calculated offset
  3. Parent controls world position/rotation; child controls visual offset
Root (empty) ← position = feet / rotation center / socket
└─ Mesh (child) ← localPosition = (0, offset, 0), has MeshFilter + MeshRenderer

Unity built-in primitive half-heights at scale 1:

PrimitiveHeightHalf-HeightOffset Formula
Capsule2m1.01.0 * scale.y
Cylinder2m1.01.0 * scale.y
Cube1m0.50.5 * scale.y
Sphere1m0.50.5 * scale.y
Custom meshvariesbounds.extents.ymesh.bounds.extents.y * scale.y

Scale goes on child, not parent. Offset in parent-local space.

  • PostTransformMatrix conflicts with TransformBaker — adding manually in a custom baker causes entity count drops and broken SubScene loading. Only use via TransformUsageFlags.NonUniformScale.
  • “Fix the data, not the code” — restructure the prefab hierarchy rather than compensating in runtime systems.
  • += offset accumulates per frame — use = (absolute) or fix in prefab.

→ Full use cases (A-F), DOTS baking behavior, ECS parent-child setup, decision framework: references/use-cases-and-ecs.md

FileContents
use-cases-and-ecs.mdUse cases A-F with code, DOTS baking, ECS gotchas, decision framework