BodyType

Physics body type.

Determines how the physics engine treats the body during simulation.

Types

  • Static — immovable body. Not affected by forces, gravity, impulses, or collisions in terms of movement. Other bodies collide with it. Use for boundaries, floors, obstacles.

  • Dynamic — fully simulated body. Affected by forces and gravity, collides, and responds to impulses. This is the default for typical “falling/stacking” UI elements.

  • Kinematic — body with infinite mass that is moved by setting its velocity (or transform) by the user/engine. It is not affected by forces/gravity, but it can push dynamic bodies. Use for moving platforms or scripted motion.

Notes

Entries

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun valueOf(value: String): BodyType

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.