Skip to content

Rigid Body

A Rigid Body represents a component that can be simulated within the physics engine. These components maintain a constant shape, hence the term ‘rigid’. Changes in a Rigid Body’s position or orientation over time are determined by the physics engine, based on forces applied to it.

Adding a Rigid Body to Mattercraft is simple and intuitive. Simply add a Physics → Rigid Body Behavior to a component.

The Rigid Body Behavior sets up and exposes everything you need to get started with physics, including creating a default Collider (depicted as a green bounding box) to wrap around your component.

Clicking the Play button in the top-left of the viewport will simulate the physics in your current active zcomponent (Scene).

Playing the simulation in the Viewport

You can update and customize your Rigid Body Behavior properties in the Behaviors Panel.

Components that have the Rigid Body Behavior attached will have the following additional properties:

PropertyDescription
Motion TypeDescribes how the Rigid Body is able to move. These options are:

Static: Not affected by external forces (collisions, gravity, etc.) and is optimized to never move. Great for platforms, buildings, etc.

Dynamic: Natural movement and affected by external forces. Used for things that need to bounce, have friction, etc.

Kinematic: Not affected by external forces but can be animated, for example, on a timeline. Perfect for things like moving platforms.
Report CollisionsIf true, an onCollision event is emitted.
BouncinessThis describes how bouncy the object will be.

0: No energy is retained and it will not bounce.

1: All energy is retained and will bounce.
FrictionDetermines how much an object will slow down. Important for simulating realistic physics, such as an object sliding across a surface.
MassSets the Rigid Body’s overall mass, which affects how easy it is to move.
InertiaDetermines how easy the object is to rotate.
Inertia OrientationDescribes the axes that a Rigid Body spins around.
Center of MassSets the Rigid Body’s mass distribution.
Gravity FactorSets the force of gravity on a Rigid Body.
Linear DampingSets how fast the linear velocity decreases on the Rigid Body over time.
Angular DampingSets how much the Rigid Body resists rotating over time.
DensitySets the Rigid Body’s overall density.

See Mattercraft’s full API documentation here.

If you’d like to customize the collider or physics settings further, check out the articles below: