Skip to main content

Physics Body Types

Godot provides four main 2D physics body types, each suited for different use cases:

RigidBody2D

Physics-simulated bodies affected by gravity, forces, and collisions.

Basic Setup

Applying Forces

Velocity Control

Damping

Collision Detection

Custom Integration

CharacterBody2D

Best for player and AI-controlled characters with precise movement control.

Basic Movement

Collision Detection

Getting Collision Information

Platformer Movement Settings

Wall Jumping

Platform Movement

StaticBody2D

Immovable bodies for walls, floors, and obstacles.
constant_linear_velocity doesn’t move the body but affects touching bodies as if it were moving.

AnimatableBody2D

For moving platforms and animated obstacles.

Collision Shapes

All physics bodies need collision shapes:

Common Shape Types

  • RectangleShape2D - Rectangles and squares
  • CircleShape2D - Circles
  • CapsuleShape2D - Capsules (good for characters)
  • ConvexPolygonShape2D - Convex polygons
  • ConcavePolygonShape2D - Concave polygons (static only)

Physics Layers and Masks

Control which objects collide with each other:

Layer Examples

Raycasting

RayCast2D Node

PhysicsRayQueryParameters2D

Area2D

Detect overlaps without physics simulation:

Manual Overlap Detection

Physics Material

Control friction and bounce:

Best Practices

CharacterBody2D provides better control and is deterministic, perfect for player characters.
Objects that should react realistically to forces like crates, balls, and ragdolls.
Properly configured layers prevent unnecessary collision checks and improve performance.
On RigidBody2D, only enable contact_monitor when you need collision signals to save performance.

Next Steps

TileMaps

Add physics to tile-based levels

Canvas Layers

Organize your game’s visual layers