Physics Bodies

Three types. One click to add.

Every physics node has a body type that determines how it behaves in the simulation.


Body types

Dynamic

Affected by gravity, forces, and collisions. The default for most objects.

Ball falls, bounces, gets pushed by collisions.

Use for: projectiles, characters, falling objects, anything that moves under physics.

Static

Immovable. Other objects collide with it but it never moves.

Platform stays in place. Ball bounces off it.

Use for: ground, walls, platforms, boundaries.

Kinematic

Moved by code, not by physics. Collides with dynamic objects but ignores forces and gravity.

Platform.x = mouse.x ← moved by formula, pushes dynamic objects

Use for: moving platforms, player-controlled paddles, elevators, formula-driven objects that need to push other things.

title: "Three body types"
description: "Dynamic ball, static ground, kinematic platform"
nodes:
  - type: ELLIPSE, name: "Ball", x: 200, y: 50, w: 40, h: 40, fill: "#E74C3C"
  - type: RECT, name: "Ground", x: 200, y: 400, w: 400, h: 20, fill: "#2C3E50"
  - type: RECT, name: "Platform", x: 150, y: 250, w: 100, h: 15, fill: "#3498DB"
modules:
  - node: "Ball", module: "physics", config: { bodyType: "dynamic", restitution: 0.6 }
  - node: "Ground", module: "physics", config: { bodyType: "static" }
  - node: "Platform", module: "physics", config: { bodyType: "kinematic" }
formulas:
  - node: "Platform", prop: "x", value: "150 + Math.sin(time) * 100"
tools_visible: [select, play]
ui_visible: [properties, modules]

Properties

PropertyTypeDefaultDescription
densitynumber1.0Mass per area. Higher = heavier.
frictionnumber0.3Surface roughness. 0 = ice, 1 = rubber.
restitutionnumber0.0Bounciness. 0 = no bounce, 1 = perfect bounce.
gravityScalenumber1.0Multiplier for gravity. 0 = no gravity, -1 = floats up.
fixedRotationbooleanfalsePrevents rotation from forces.
fixXbooleanfalseLocks horizontal position.
fixYbooleanfalseLocks vertical position.

Axis locking

fixX and fixY lock individual axes. When toggled on, the current position is captured as the lock point.

Use cases:

  • fixX — vertical rail (elevator)
  • fixY — horizontal rail (sliding door)
  • fixX + fixY — static position but still rotates and collides

Formula API

Inside formulas and event handlers, physics nodes expose:

this.velocityX          // read/write horizontal velocity
this.velocityY          // read/write vertical velocity
this.angularVelocity    // read/write spin speed

this.applyForce(fx, fy)     // continuous force (like thrust)
this.applyImpulse(ix, iy)   // instant push (like jump)

Sensor mode

this.sensor = true      // detects overlap without physical collision

Sensors fire collide events but don't push other objects. Use for trigger zones, detection areas, collectibles.

Simulation details

  • Fixed timestep — accumulator-based stepping for stable, deterministic simulation
  • 50 pixels per meter — coordinate conversion handled automatically
  • Kinematic velocity sync — kinematic bodies moving via formulas automatically calculate velocity for smooth dynamic body interaction
  • Nested transforms — physics objects inside frames/groups use parent transform resolver for correct world-space positioning

Back to physicsCollidersCollision events

← НазадCollidersДальше →Gravity Attractors