natiny.entity.set_parent
natiny.entity.set_parent(child, parent)
Sets the parent of a node, creating a parent-child hierarchy. The child node's transform becomes relative to its parent.
Parameters
| Name | Type | Description |
|---|---|---|
child |
number |
Child Entity handle |
parent |
number |
Parent entity handle, or 0 to detach |
Example
natiny.entity.set_parent(hand, arm)
Notes
- Detaching is also what spares a child from its parent's
destroy: everydestroythat owns an entity takes the whole subtree under it with it.