Base class for all physics bodies. Access via the 'physics' submodule.
Experimental API:
The physics submodule is an experimental and new API that is highly susceptible to breaking changes in the future.
| Name | Description | Type |
|---|---|---|
pos | The position of the body in world coordinates. | Vec2 |
rotation | The rotation of the body in radians. | float |
collision_layer | The body's collision layer (category bits). | int |
collision_mask | The body's collision mask. | int |
is_valid | Indicates whether the body is not destroyed. | bool |
get_transform() → Transformget_transform() → TransformGet the current transform of the body (position, rotation, and scale).
Returns
Transform : The current transform of the body.
destroy() → Nonedestroy() → NoneDestroy the body manually.