Skip to content

Rigidbody2D ​

Physics 2DScripts: Rigidbody2DComponentFeature: 2D Physics (≈45 KB)

Optional feature

Rigidbody2D is part of 2D Physics. A build includes it only when a scene, prefab or script uses it — see Feature cropping.

From a script ​

ts
import { Rigidbody2DComponent } from "mmpx";

const rigidbody2D = this.entity.TryGetComponent(Rigidbody2DComponent);

Full API: Rigidbody2DComponent.

Fields ​

FieldTypeDefaultDescription
Body Type
bodyType
"dynamic" | "kinematic" | "static""dynamic"Dynamic: moved by forces and collisions. Kinematic: moved only by velocity / MovePosition, pushes dynamic bodies, unaffected by them. Static: never moves (but follows its Transform)
Use Auto Mass
useAutoMass
booleanfalseMass from the colliders' density × area (kg per square metre)
Mass
mass
number (0.0001 … ∞) (kg)1
Linear Damping
linearDamping
number (0 … ∞)0Slows the movement down over time (air drag)
Angular Damping
angularDamping
number (0 … ∞)0.05Slows the spin down over time
Gravity Scale
gravityScale
number1Multiplies the world gravity for this body (0 = floats)
Freeze Rotation
fixedRotation
booleanfalseNever rotates (characters)
Collision Detection
collisionDetection
"discrete" | "continuous""discrete"Continuous keeps fast bodies (bullets) from tunnelling through other moving bodies — costs more
Sleeping Mode
sleepMode
"startAwake" | "startAsleep" | "neverSleep""startAwake"A resting body sleeps (costs nothing) until something touches it
Interpolation
interpolation
"none" | "interpolate""interpolate"Smooths the drawn movement between physics steps (when frames outnumber ticks)

© 2026 PlayAdGentic