Skip to main content

Introduction to 3D Physics

Godot’s 3D physics system provides realistic simulation of rigid bodies, character controllers, and collision detection. Understanding the different physics body types and how to configure them is essential for creating interactive 3D games.

Physics Body Types

RigidBody3D

Dynamic physics simulation

CharacterBody3D

Script-controlled movement

StaticBody3D

Immovable environment

AnimatableBody3D

Animated kinematic body

Area3D

Detection zones

RigidBody3D

Physics bodies controlled by the physics engine. Perfect for objects that need realistic physics simulation.

Basic Setup

See doc/classes/RigidBody3D.xml:7-9
Changing linear_velocity or transform frequently can cause unpredictable behavior. Use forces and impulses instead.

Mass and Inertia

See doc/classes/RigidBody3D.xml:225-226, 186-189, 147-149, 151-152

Applying Forces

Forces are applied every physics frame:
See doc/classes/RigidBody3D.xml:52-57, 69-76, 88-94

Velocity Control

See doc/classes/RigidBody3D.xml:219-220, 141-142, 125-130

Damping

Control how quickly motion slows down:
See doc/classes/RigidBody3D.xml:212-214, 216-217, 134-136, 138-139

Freeze and Lock

See doc/classes/RigidBody3D.xml:174-177, 179-181, 222-223

Collision Detection

See doc/classes/RigidBody3D.xml:162-164, 228-230, 105-109, 112-116, 241-246, 248-253

Custom Integration

See doc/classes/RigidBody3D.xml:21-26, 170-172

Sleep Mode

See doc/classes/RigidBody3D.xml:144-145, 236-237

CharacterBody3D

Script-controlled physics body perfect for player characters.

Basic Setup

See doc/classes/CharacterBody3D.xml:6-8

Movement with move_and_slide

See doc/classes/CharacterBody3D.xml:132-140, 189-191

Floor Detection

See doc/classes/CharacterBody3D.xml:108-112, 114-118, 33-36, 26-31

Wall and Ceiling Detection

See doc/classes/CharacterBody3D.xml:120-124, 89-94, 96-100

Collision Information

See doc/classes/CharacterBody3D.xml:83-87, 76-81, 46-49

Motion Modes

See doc/classes/CharacterBody3D.xml:165-166, 186-187, 198-203

Floor Behavior

See doc/classes/CharacterBody3D.xml:158-160, 147-149, 144-145, 154-156

Platform Interaction

See doc/classes/CharacterBody3D.xml:58-62, 52-56, 168-169, 174-175, 171-172, 204-212

StaticBody3D

Immovable environment objects like floors, walls, and props.

Basic Setup

See doc/classes/StaticBody3D.xml:6-9

Constant Velocities

Simulate conveyor belts or rotating platforms:
See doc/classes/StaticBody3D.xml:22-24, 19-20
These velocities don’t move the StaticBody3D itself - they affect touching dynamic bodies as if the static body were moving.

CollisionShape3D

Defines the collision boundaries for physics bodies.

Shape Types

Setting Up Collision

See doc/classes/CollisionShape3D.xml:42-43, 39-40
Always change disabled with set_deferred() to avoid physics engine conflicts.

Debug Visualization

See doc/classes/CollisionShape3D.xml:32-34, 36-37

Physics Materials

Control friction and bounce:
See doc/classes/RigidBody3D.xml:232-234, doc/classes/StaticBody3D.xml:25-27

Joints and Constraints

Connect physics bodies together:

Pin Joint

Hinge Joint

Slider Joint

Raycasting in 3D

Detect objects along a ray:

Using RayCast3D Node

Direct Space State Query

Shape Casting

Collision Layers and Masks

Control what collides with what:

Performance Optimization

Prefer primitive shapes over complex meshes:
Only for fast-moving objects:
Only monitor when needed:
Let idle bodies sleep:
Avoid unnecessary collision checks:

Common Patterns

Pickup Item

Exploding Barrel

Jump Pad

3D Overview

3D coordinate systems and transforms

Meshes and Materials

Visual representation

Area3D

Detection zones and triggers

Physics Troubleshooting

Common physics issues

Resources