natiny.physics.set_fixed_rotation
natiny.physics.set_fixed_rotation(body, enabled)
Locks or unlocks rotation of a body around all three axes at once. A locked body keeps the orientation it has and cannot be turned by gravity, contacts or impulses.
Parameters
| Name | Type | Description |
|---|---|---|
body |
number |
Body handle |
enabled |
boolean |
true to lock all three rotation axes; false to release them |
Example
local player = natiny.physics.cylinder(0.4, 1.8)
natiny.physics.set_fixed_rotation(player, true)