Skip to content

RigidBody

Every physics entity needs a RigidBody component. It defines the body type and physical properties.

Properties

PropertyTypeDefaultDescription
bodyTypenumber2 (Dynamic)0=Static, 1=Kinematic, 2=Dynamic
gravityScalenumber1.0Gravity multiplier
linearDampingnumber0.0Linear velocity damping
angularDampingnumber0.0Angular velocity damping
fixedRotationbooleanfalseLock rotation
bulletbooleanfalseCCD for fast objects
enabledbooleantrueEnable physics body

Body Types

Static (0)

Does not move. Used for walls, floors, and platforms. Static bodies have infinite mass and do not respond to forces.

rigidBody.bodyType = 0;

Kinematic (1)

Moved by code (transform), not by physics forces. Other bodies collide with it but don’t push it. Used for moving platforms and elevators.

rigidBody.bodyType = 1;

Dynamic (2)

Fully simulated. Responds to gravity, forces, and collisions. Used for players, projectiles, and physics objects.

rigidBody.bodyType = 2;

Usage Notes

  • gravityScale allows per-body gravity adjustment. Set to 0 for zero-gravity objects, negative values for reverse gravity.
  • fixedRotation is useful for character controllers that should not rotate on collision.
  • bullet enables continuous collision detection (CCD), which prevents fast-moving objects from tunneling through thin colliders. Use sparingly as it has a performance cost.
  • linearDamping and angularDamping simulate air resistance. Higher values slow the body faster.

See Also

  • Physics Overview — setup and coordinate conversion
  • Colliders — attaching collider shapes to rigid bodies
  • API — runtime force and velocity control