Physics Overview
An introduction to ShapeBox's built-in physics engine — simulate gravity, collisions, constraints, and forces without writing code.
Physics Overview
ShapeBox includes a built-in real-time physics engine powered by a high-performance rigid-body simulator. You can give any object physical properties — making it fall, bounce, roll, or collide — directly from the Inspector without writing a single line of code.
How physics works in ShapeBox
Physics runs as part of your scene's simulation. It is inactive in editing mode so you can arrange objects freely. When you click Play (or a visitor enters your published scene), the physics simulation starts and all physics-enabled objects begin interacting.
Body types
Every physics-enabled object must have a body type:
| Body type | Description |
|---|---|
| Dynamic | Fully simulated — falls with gravity, responds to forces and collisions |
| Static | Fixed in place — other objects collide with it, but it never moves |
| Kinematic | Moved by scripts or animations — collides with dynamic bodies without being affected by gravity |
Choosing the right type
- Dynamic — use for balls, boxes, props, characters that fall or tumble.
- Static — use for floors, walls, terrain, and other permanent structures.
- Kinematic — use for moving platforms, doors, elevators, and anything animated but still collideable.
Enabling physics on an object
- Select the object in the editor.
- In the Inspector, open the Physics section.
- Toggle Physics Enabled on.
- Choose a Body Type (Dynamic, Static, or Kinematic).
- Press Play to test.
Core physics properties
| Property | Description |
|---|---|
| Mass | Determines how the object responds to forces (kg). Default: 1.0. |
| Gravity Scale | Multiplies the global gravity for this object. 0 = weightless, 2 = double gravity. |
| Linear Damping | Air resistance for translation — slows down moving objects over time. |
| Angular Damping | Air resistance for rotation — slows down spinning objects over time. |
| Restitution | Bounciness (0 = no bounce, 1 = perfectly elastic). Default: 0.3. |
| Friction | Surface friction coefficient (0 = frictionless, 1 = very sticky). Default: 0.5. |
Global physics settings
Adjust the simulation globally via Editor → Scene Settings → Physics:
| Setting | Default | Description |
|---|---|---|
| Gravity | -9.81 m/s² (Y axis) | The direction and strength of gravity |
| Time Step | 60 Hz | How many times per second the simulation updates |
| Max Iterations | 10 | Solver iterations per step — higher = more accurate but slower |
Next steps
- Rigid Bodies — deep-dive into body properties, forces, and constraints.
- Colliders — choose the right collision shape for accuracy and performance.