natiny.physics.sphere

Lua
natiny.physics.sphere([radius]) -> body

Creates a dynamic sphere-shaped body at the world origin.

Parameters

Name Type Default Description
radius number 1 Radius in metres

Returns

Type Description
number Body handle, also usable as an entity handle

Example

Lua
local ball = natiny.physics.sphere(0.5)

Notes

  • Centred on the body's origin, and the body starts at the world origin.
  • The body is dynamic; natiny.physics.set_type changes that.
  • Scaling the entity does not scale the collider.
  • Lua raises an error when physics is not running or the body cannot be made.