natiny.physics.plane
Lua
natiny.physics.plane([w [, d]]) -> body
Creates a static, flat rectangle in the XZ plane: the ground.
Parameters
| Name |
Type |
Default |
Description |
w |
number |
1 |
Width, the full size along X |
d |
number |
w |
Depth, the full size along Z |
Returns
| Type |
Description |
number |
Body handle, also usable as an entity handle |
Example
Lua
local ground = natiny.physics.plane(50, 50)
Notes
- The rectangle lies in the XZ plane, faces
+Y, and is centred on the
body's origin.
- Not infinite: whatever goes over the edge keeps falling.
- The body is static. Making it dynamic gives it no mass, because a flat
surface has no volume; use
natiny.physics.cube for a moving floor.
- Lua raises an error when physics is not running or the body cannot be made.