natiny.physics.set_type
Lua
natiny.physics.set_type(body, type)
Changes what the solver is allowed to do with a body.
Parameters
| Name |
Type |
Description |
body |
number |
Body handle |
type |
number |
natiny.physics.BODY_DYNAMIC, natiny.physics.BODY_STATIC or natiny.physics.BODY_KINEMATIC |
Constants
| Name |
Description |
natiny.physics.BODY_DYNAMIC |
Has mass, moved by forces and collisions |
natiny.physics.BODY_STATIC |
Not moved by forces, velocity or collisions |
natiny.physics.BODY_KINEMATIC |
Moved by the game; pushes dynamic bodies without being pushed back |
Example
Lua
natiny.physics.set_type(wall, natiny.physics.BODY_STATIC)