natiny.physics.cylinder

Lua
natiny.physics.cylinder([radius [, height]]) -> body

Creates a dynamic cylinder-shaped body at the world origin, standing upright along Y.

Parameters

Name Type Default Description
radius number 1 Radius in metres
height number radius * 2 Full height along Y, in metres

Returns

Type Description
number Body handle, also usable as an entity handle; raises an error on failure

Example

Lua
local barrel = natiny.physics.cylinder(0.4, 1.2)
natiny.entity.set_position(barrel, natiny.entity.SPACE_WORLD, 0, 5, 0)