natiny.pivot.create

Lua
natiny.pivot.create([parent]) -> pivot

Creates a transform-only entity for grouping and positioning child entities. The pivot itself is not rendered and produces no audio.

Parameters

Name Type Default Description
parent number nil Parent entity handle, or nil to create the pivot at the scene root

Returns

Type Description
number Pivot handle, also usable with the natiny.entity API; raises an error on failure

Example

Lua
local turret = natiny.pivot.create(tank)
natiny.entity.set_position(turret, natiny.entity.SPACE_LOCAL, 0, 1.2, 0)
natiny.entity.set_parent(barrel, turret)

Notes