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
Mass and Inertia
Applying Forces
- Forces (Continuous)
- Impulses (One-Time)
- Constant Forces
Forces are applied every physics frame:See doc/classes/RigidBody3D.xml:52-57, 69-76, 88-94
Velocity Control
Damping
Control how quickly motion slows down:Freeze and Lock
Collision Detection
Custom Integration
Sleep Mode
CharacterBody3D
Script-controlled physics body perfect for player characters.Basic Setup
Movement with move_and_slide
Floor Detection
Wall and Ceiling Detection
Collision Information
Motion Modes
Floor Behavior
Platform Interaction
StaticBody3D
Immovable environment objects like floors, walls, and props.Basic Setup
Constant Velocities
Simulate conveyor belts or rotating platforms: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
Debug Visualization
Physics Materials
Control friction and bounce: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
Use Simple Collision Shapes
Use Simple Collision Shapes
Prefer primitive shapes over complex meshes:
Enable Continuous Collision Detection Selectively
Enable Continuous Collision Detection Selectively
Only for fast-moving objects:
Limit Contact Monitoring
Limit Contact Monitoring
Only monitor when needed:
Use Sleep Mode
Use Sleep Mode
Let idle bodies sleep:
Organize with Collision Layers
Organize with Collision Layers
Avoid unnecessary collision checks:
Common Patterns
Pickup Item
Exploding Barrel
Jump Pad
Related Topics
3D Overview
3D coordinate systems and transforms
Meshes and Materials
Visual representation
Area3D
Detection zones and triggers
Physics Troubleshooting
Common physics issues
Resources
- Physics Introduction
- Troubleshooting Physics Issues
- 3D Physics Tests Demo
- RigidBody3D Reference: doc/classes/RigidBody3D.xml
- CharacterBody3D Reference: doc/classes/CharacterBody3D.xml
- StaticBody3D Reference: doc/classes/StaticBody3D.xml
- CollisionShape3D Reference: doc/classes/CollisionShape3D.xml