attach
Since 0.7
Follows a bone of another entity's animated skeleton (a held prop; with a trigger collider, a sensor reporting overlap events): world = owner * bone * (position, rotation), after the owner's animator samples each tick.
Use it in a scene entity's components list as { "type": "attach", … }. The contract writes the fields flat and refuses unknown keys.
Fields
| Field | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|
to | string | yes | The entity whose animator's skeleton carries this one. It needs an animator component. | ||
bone | string | yes | A bone of that skeleton, by the rig's own name (for a rig that is retargeted, the canonical name from retarget.map also works). Resolved once when the scene loads: a name the rig does not have is reported as attach-bone-unknown and the entity stays where it is. | ||
position | Vec3 | no | [0,0,0] | Offset from the bone, metres, in the bone's frame. Default [0, 0, 0]. | |
rotation | Quat | no | identity | Turn relative to the bone, a quaternion [x, y, z, w] in the bone's frame. Default identity. | |
activeWhile | string | no | For a sensor (a trigger collider on this entity): query only while the owner's animator has its window of this name open (an animator events entry with until). |
Rules that can refuse it
attach-bone-unknownattach-owner-missingattach-owner-no-animatorattach-skeleton-missing