This document is about: QUANTUM 3
SWITCH TO

Quantum Physics Basics: Colliders, Bodies, Materials, and Layer Matrix

This page accompanies the Photon Quantum Physics Basics #1 - Colliders, Physics Bodies & Layer Matrix video and explains the basic building blocks of Quantum 3D physics.

Use this page as a foundation before moving into more advanced Quantum physics topics such as character controllers, triggers, queries, gameplay interactions, or custom physics-driven systems.

Photon Quantum Physics Basics #1 - Colliders, Physics Bodies & Layer Matrix

Overview

Photon Quantum includes a deterministic physics engine that supports Quantum’s predict/rollback simulation model.

Quantum supports both 2D and 3D physics. 2D physics can also be used for 2.5D games, but this video focuses on 3D physics.

The video covers:

  • how the Quantum Physics System is enabled and disabled;
  • the difference between physics colliders and physics bodies;
  • how Quantum can use Unity collider shapes as collider sources;
  • how to configure collider types directly in Quantum;
  • how physics materials affect collision behavior;
  • where global physics settings are configured;
  • how to use the Physics Layer Matrix;
  • when to use static colliders and static mesh colliders.

Video Timeline

Time Section
00:00 Start
00:12 Introduction
00:53 Physics System
01:38 Physics Colliders
02:55 Physics Materials
03:30 Physics Configuration
04:05 Layer Matrix
04:50 Static Colliders

Physics in Quantum

Physics in Quantum is not a black box. It is a simulation system like any other Quantum system.

The active physics behavior depends on which systems are enabled in the selected Systems Config.

For a 3D project, enable the 3D physics system.

For a 2D project, enable the 2D physics system instead.

By default, both 2D and 3D physics may be enabled in the default simulation configuration. If your project only uses one physics mode, remove the one you do not need to avoid unnecessary simulation cost.

Physics System

The Physics System is responsible for running physics simulation logic.

To inspect the active systems:

  1. Open the Quantum Debug Runner.
  2. Select the active Systems Config.
  3. Check which systems are enabled.

In the example scene, only the following systems are enabled:

  • Culling;
  • Physics (3D).

This keeps the sample focused and avoids running systems that are not needed.

Disabling the Physics System

If the Physics System is disabled, physics bodies will no longer simulate.

In the video example:

  • when Physics (3D) is enabled, basketballs bounce off the ground;
  • when Start Disabled is enabled for the physics system, the basketballs stay still.

This confirms that physics behavior depends on the active Quantum system configuration.

Physics Colliders and Physics Bodies

A dynamic physics object usually needs both:

Component Purpose
PhysicsCollider3D Defines the object’s collision shape.
PhysicsBody3D Defines how the object moves and reacts to forces.

The collider describes the shape used for collision detection.

The body defines dynamic behavior, such as movement, gravity, velocity, mass, and force response.

PhysicsCollider3D

PhysicsCollider3D defines the collision shape of an entity.

In the basketball example, the PhysicsCollider3D source is set to a Unity Sphere Collider.

When the simulation starts, Quantum uses the Unity collider source to create its own deterministic internal collider shape.

This is useful when you want the Quantum collider to match the shape already configured in Unity.

Collider Sources

Quantum colliders can be created from Unity collider sources or configured directly in the Quantum component.

Common setups include:

Setup Example
Unity collider source Basketball using a Unity Sphere Collider as source.
Direct Quantum collider type Standing lamp using a Capsule collider configured in PhysicsCollider3D.
Box collider Small lamp using a Box collider.
Compound collider Couch using multiple colliders combined into one entity.

Editing Collider Shapes

Collider shapes can be adjusted directly in the Unity Scene view.

Quantum collider editing behaves similarly to Unity’s native collider tools. You can select the editing tool and modify shape parameters visually.

This makes it easier to align deterministic Quantum colliders with the visible mesh or object layout.

Compound Colliders

Use a compound collider when a single primitive shape is not accurate enough.

A compound collider combines multiple collider shapes into one entity collider setup.

This is useful for objects like:

  • furniture;
  • vehicles;
  • large props;
  • irregularly shaped interactive objects.

In the video, the couch uses a compound collider.

Physics Materials

Physics materials define how objects behave during collision.

The basketballs use a custom:

Basketball Physics Material

One important property is:

Restitution

Restitution controls how bouncy an object is.

Restitution Value Result
0 Object loses its bounce.
1 Object keeps strong bounciness.

Restitution Combine Function

The restitution combine function defines how restitution values are combined when two colliders interact.

In the video, changing the combine function to:

Multiply

makes collisions feel more subtle. The basketballs gradually settle instead of stopping abruptly.

This is useful when collision response needs to feel less aggressive or more physically stable.

Global Physics Configuration

Global physics settings are stored in the simulation configuration.

To find the config:

  1. Use the Unity Project search bar.
  2. Search for config simulation.
  3. Select the relevant simulation config ScriptableObject.

This configuration contains global physics settings such as:

  • gravity;
  • continuous collision detection;
  • penetration correction;
  • sleep tolerances;
  • integration thresholds;
  • contact behavior settings.

The example scene uses adjusted physics settings to improve stacking stability.

Relevant settings include:

Setting Purpose
Penetration Correction Helps resolve overlapping colliders.
Min Linear Integration Controls minimum linear integration behavior.
Min Angular Integration Controls minimum angular integration behavior.
Min Contact Inverse Mass Affects contact resolution behavior.
Linear Sleep Tolerance Controls when linear motion can be considered sleeping.
Angular Sleep Tolerance Controls when angular motion can be considered sleeping. Uses radians.

These settings can help prevent objects from jittering, sinking, or behaving unstably when resting on each other.

Physics Layer Matrix

The Physics Layer Matrix controls which layers collide with each other.

It works similarly to Unity’s layer collision matrix.

Use it when specific object categories should not physically interact.

Example use case:

A rotating lamp should not collide with the player or soccer ball.

Creating and Importing Layers

To configure Quantum physics layers:

  1. Create the layers in Unity, for example:
    • Lamp;
    • SoccerBall.
  2. Open the Quantum simulation config.
  3. Scroll to the Layers section.
  4. Click Import Layers from Unity.

Quantum can now use the Unity-defined layers in the physics layer configuration.

Disabling Collisions Between Layers

After importing layers:

  1. Open the collision matrix.
  2. Find the relevant layer combination.
  3. Disable collisions between Lamp and SoccerBall.
  4. Assign the correct layers to the relevant objects.
  5. Press Play.

The assigned objects will no longer physically interact with each other.

This is useful for filtering collisions between categories such as:

  • players and decorative props;
  • projectiles and owners;
  • enemies and enemy-only triggers;
  • pickups and environment objects;
  • VFX helpers and gameplay colliders.

Static Colliders

Static colliders are used for geometry that does not move.

Quantum supports static mesh colliders for static geometry, but mesh colliders are not supported on dynamic entities for performance reasons.

Use static colliders for objects such as:

  • ground;
  • walls;
  • platforms;
  • level geometry;
  • furniture that should not move;
  • decorative collision surfaces.

Static Mesh Colliders

To convert an object like a couch into a static collider:

  1. Remove entity-related components such as:
    • Transform3D;
    • EntityPrototype;
    • EntityView.
  2. Add:
    • Quantum Static Mesh Collider 3D.
  3. Save the scene.

The object is no longer a dynamic Quantum entity. Instead, Quantum treats it as part of the static world.

It will not move when hit by physics bodies.

Static Collider Baking

When static colliders are changed and the scene is saved, Quantum recalculates the static collider data.

This data is stored in the:

Map Asset Object

To inspect the map data:

  1. Select the QuantumMap GameObject in the hierarchy.
  2. Check the generated static collider information.

This baking step allows Quantum to include static geometry in the deterministic simulation efficiently.

Dynamic vs Static Physics Objects

Type Uses Moves During Simulation Typical Components
Dynamic physics entity Balls, players, movable props Yes PhysicsBody3D, PhysicsCollider3D, QuantumEntityPrototype, EntityView
Static collider Ground, walls, static furniture No Quantum Static Mesh Collider 3D
Compound dynamic entity Complex movable object Yes PhysicsBody3D, PhysicsCollider3D with compound shape
Collider-only object Trigger or non-dynamic collision object Depends on setup PhysicsCollider3D

Key Concepts

Concept Description
Physics System Quantum system responsible for running physics simulation.
PhysicsBody3D Makes an entity dynamic and responsive to forces.
PhysicsCollider3D Defines the collision shape of an entity.
Collider Source A Unity collider or configured Quantum shape used to create the deterministic collider.
Physics Material Defines collision properties such as restitution.
Restitution Controls bounciness.
Restitution Combine Function Defines how restitution values are combined during collision.
Simulation Config Stores global physics settings.
Physics Layer Matrix Controls which physics layers collide.
Static Collider Non-moving collision geometry baked into the map.
Static Mesh Collider Mesh-based collider for static world geometry.
Map Asset Object Stores baked static collider data.

Best Practices

Use this checklist when setting up basic Quantum physics:

  • Enable only the physics system your project needs.
  • Disable unused 2D or 3D physics systems to avoid unnecessary cost.
  • Use PhysicsBody3D for dynamic objects that should move or react to forces.
  • Use PhysicsCollider3D to define simulation collision shapes.
  • Use Unity collider sources when you want Quantum colliders to match Unity collider setup.
  • Configure Quantum collider types directly when you need explicit deterministic shapes.
  • Use compound colliders for complex dynamic objects.
  • Use physics materials to control bounce and collision response.
  • Tune global physics settings for stable stacking and resting behavior.
  • Use the Physics Layer Matrix to prevent unwanted collisions.
  • Import Unity layers into the Quantum config before using them in the matrix.
  • Use static mesh colliders only for static geometry.
  • Remove entity components from objects that should become pure static colliders.
  • Save the scene after changing static collider setup so Quantum can recalculate map data.

Common Pitfalls

Pitfall Why It Is a Problem
Leaving both 2D and 3D physics enabled when only one is needed Wastes simulation performance.
Expecting physics to run while the Physics System is disabled Physics behavior depends on the active system configuration.
Adding only a collider to a dynamic object The object has shape, but no dynamic body behavior.
Adding only a body without a proper collider The object may move but not collide as expected.
Using dynamic mesh colliders Quantum does not support mesh colliders on dynamic entities for performance reasons.
Forgetting to import Unity layers Quantum will not know about new Unity layers until they are imported.
Editing the layer matrix but not assigning layers to objects The matrix has no effect unless objects use the configured layers.
Keeping entity components on static mesh collider objects Static world geometry should not remain configured as a dynamic entity.
Forgetting to save after static collider changes Static collider data may not be recalculated into the map asset.

Summary

Quantum physics is part of the deterministic simulation and is controlled through explicit systems, components, materials, and configuration assets.

Dynamic objects use PhysicsBody3D and PhysicsCollider3D. Physics materials define collision response, such as bounciness. The simulation config stores global physics settings and the Physics Layer Matrix controls which layers can collide.

Static world geometry should use static colliders or static mesh colliders and is baked into the map asset.

This setup provides the foundation for more advanced Quantum physics workflows, including character movement, triggers, gameplay collision handling, physics queries, and custom physics-driven mechanics.

Back to top