Unity does not treat an asset as a single object. It treats it as a hierarchy of transforms, and that is exactly why part-controllable exports fit well — provided the pivot of each part is placed deliberately. Import first, rig second, and the hinge will look correct in the editor while the lid flies off in play mode.

Getting glTF into Unity at all

Unity has no built-in glTF importer in the standard editor, so a GLB part export arrives through a package (glTFast, UnityGLTF and similar) or through a conversion step to FBX. Both routes are viable; the choice affects what you can verify automatically. Package importers preserve node names and transforms and are usually easier to script against; an FBX conversion round-trip can rename nodes, so it needs a name check afterwards.

Whatever the route, import into a dedicated folder per asset and confirm three things before opening a scene: the object count, the names, and the bounding-box size of one part you already measured.

Units and axes are the first bug

glTF is metres and right-handed. Unity is metres and left-handed. A compliant importer converts the handedness for you, which means a model that appears mirrored or rotated 90 degrees on import usually indicates a second conversion applied on top — a source file already rotated, or a prefab rotation saved from an earlier attempt.

The reliable check is a single asymmetric part. A chest lid that is 2 units wide, 1 high and 4 deep should read exactly that in the Inspector. If it reads 200, 100 and 400, a centimetre scale is being applied. If it reads 2, 4 and 1, two axes were swapped.

Fix scale at the import settings, not by scaling the prefab root. A prefab root at 0.01 scale looks right and breaks every later calculation, including colliders and animation distances.

Put the pivot where the motion is

Rotating a mesh transform rotates around its pivot, which comes from the file's node transform. Generated geometry usually has a centred pivot, which is wrong for anything that hinges. There are two clean patterns.

Parent-empty pattern. Create an empty GameObject at the hinge line, parent the lid to it, and set the lid's local position to the negative of the pivot offset. Rotate the empty; the lid swings correctly and the lid's own transform stays simple.

Pivot edit in the importer. Some importers expose a pivot override. It is faster but tool-specific, and it must be repeated for every reimport.

The parent-empty pattern is the boring option, which is why it survives reimports and version control. The calculator in this guide returns the offset for a given part size, axis and edge, plus a padded collider size, so the numbers you type into the lid's local position are not guesses.

Hinge pivot and collider calculator

Enter a part's local size in engine units. The calculator returns the pivot offset for a hinge on that edge and a padded box collider.

Colliders sized from real dimensions

A box collider on a named part should be the part's bounding box plus a small padding, expressed in the same local space as the mesh. Padding above ten percent is visible as hovering; negative padding lets the player clip into geometry.

For dynamic parts, a BoxCollider is almost always better than a MeshCollider: it is cheaper and stable. A convex MeshCollider is acceptable for a hero part with an unusual silhouette, and a non-convex MeshCollider must stay on a static object — Unity will not simulate a rigidbody on it.

Do not put a collider on tiny decorative parts. A handle or a lock adds collision work and produces snagging edges the player will feel but not understand.

Prefab structure that matches the schema

The prefab should be readable as the schema. Root Chest, children Lid, Base, Lock, Handle, with Hinges either present as a decorative child or omitted. One behaviour component on the root resolves the children by name and raises a named error if one is missing — the same strict-lookup rule as any other engine.

Keep the mapping in one place. A serialized field per part, assigned in the inspector, is a small amount of setup that removes all string lookups from runtime. If the part list is dynamic, resolve once at startup and cache.

Record the part list in the prefab's description or in a ScriptableObject asset. When a later export renames a part, the failure appears at the point of resolution with a readable name instead of surfacing as a null reference in an animation event.

Animation and the pivot

For a hinge, animate the parent empty's local Euler angle on one axis only. A single-axis rotation avoids the interpolation surprises that appear when two axes are keyed on a 90-degree swing. Set the wrap mode and the curve tangents explicitly: an auto tangent that overshoots past 90 degrees will push the lid through the base and back, which looks like a physics bug and is not one.

If the motion must react to the player, use a configurable joint on the hinge empty with limits matching the animation range. Do not mix an animated rotation and a joint on the same transform; the two systems will fight, and the winner depends on execution order.

Acceptance pass before prefabbing

  1. Part count equals the schema count; names match exactly.
  2. One measured dimension matches in metres; no prefab-level scale compensation.
  3. Each moving part rotates around the intended edge with the seam closed through its full range.
  4. Colliders are boxes with padding under ten percent; no collider on decorative pieces.
  5. The root resolves every part and reports a missing name without a null reference.
  6. The prefab survives a reimport of the GLB with its component references intact.

Where the pipeline ends

Unity is a consumer. The named parts must exist before import; the released CubePart code documents decomposition of an existing mesh with part names and weights, and the hosted demo was paused when this site checked on 2026-11-13. What Unity can guarantee is that a correct export stays correct: names preserved, scale honest, pivots where you put them. Everything after that is design.

Reimports and version control

An asset that is imported once is easy. An asset that is regenerated is where pipelines fail, because a reimport can reset import settings, rename nodes and silently detach references. Plan for the second import from the beginning.

Keep the generated files in a folder the importer owns, and the prefab outside it. Configure import settings with a preset so a reimport applies the same scale and material rules. Resolve parts at startup by name against the prefab's cached list, not by serialized direct references to generated objects, unless you are prepared to reassign them on every regeneration.

For version control, commit the generated files only if the pipeline cannot reproduce them deterministically, and commit the schema, the settings preset and the prefab either way. A reviewer should be able to answer "what changed" from the schema diff rather than from a binary mesh diff that no tool can read.

Then run the same acceptance pass after a reimport as after the first import. The failure this catches most often is a part that was renamed in a newer export — the prefab still loads, the missing part simply never appears, and the bug is a feature that quietly stops working weeks later.