Core Systems quest

Physics Guide. Choose the right body type, collision layer, and movement API before tuning feel.

10-20 min · Godot 4.7
Start here

Which body should I use?

Pick the body by ownership of motion first: you drive it, physics drives it, it blocks, or it only detects.

Goal Use Why
I move it with code and need collision response. CharacterBody2D You own velocity. Godot resolves sliding, floor checks, and wall contact.
The physics simulation should move it. RigidBody2D Apply forces or impulses, then let the physics server integrate motion.
It blocks movement but does not move. StaticBody2D Cheap, stable collision for level geometry and fixed obstacles.
It detects overlap but should not block. Area2D Use signals or overlap queries for pickups, hurt zones, sensors, and checkpoints.
It is a moving platform or conveyor. AnimatableBody2D Move it from code or animation while keeping predictable collision behavior.
Godot 4.6+ note

Jolt Physics is the default 3D physics engine for new projects. The body-type decisions below still apply: CharacterBody for controlled movement, RigidBody for simulation, StaticBody for fixed collision, and Area for overlap detection.

You control motion

CharacterBody2D

Players, enemies, controllable NPCs
Unity habit to replace

Think of this as "Rigidbody2D plus CharacterController behavior." You set velocity, then call move_and_slide().

move_and_slide()

Default choice for platformers, top-down movement, slopes, and walls.

  • Updates is_on_floor() and is_on_wall()
  • Slides along surfaces automatically
  • Works with the built-in velocity property

move_and_collide()

Use when you need custom collision response.

  • Returns a KinematicCollision2D
  • You decide bounce, stop, redirect, or custom slide behavior
  • Better for unusual movement rules than normal characters

Platformer movement

player_platformer.gd
extends CharacterBody2D
 
@export var speed := 300.0
@export var jump_velocity := -420.0
 
var gravity: float = ProjectSettings.get_setting("physics/2d/default_gravity")
 
func _physics_process(delta: float) -> void:
    if not is_on_floor():
        velocity.y += gravity * delta
 
    var direction := Input.get_axis("move_left", "move_right")
    velocity.x = direction * speed
 
    if Input.is_action_just_pressed("jump") and is_on_floor():
        velocity.y = jump_velocity
 
    move_and_slide()
Practice next

Create a CharacterBody2D with a CollisionShape2D and Sprite2D. Add Input Map actions for move_left, move_right, and jump, then test floor and wall behavior.

Physics controls motion

RigidBody2D

Crates, balls, debris, physics puzzles
Unity habit to keep

This maps closely to Rigidbody2D. Apply impulses and forces instead of writing transform position directly.

Forces and impulses

physics_object.gd
extends RigidBody2D
 
@export var thrust := 420.0
@export var launch_impulse := Vector2(180.0, -260.0)
 
func _ready() -> void:
    apply_central_impulse(launch_impulse)
 
func _physics_process(_delta: float) -> void:
    if Input.is_action_pressed("thrust"):
        var force := Vector2.UP.rotated(rotation) * thrust
        apply_central_force(force)
Do not fight the solver

If you set position or linear_velocity every frame, collision can look jittery or unfair. Use impulses, forces, gravity scale, damping, or the custom integrator when you need control.

World collision

StaticBody2D

Walls, floors, ledges, immovable hazards
Unity habit to replace

This is like a Collider2D without a Rigidbody. It blocks physics bodies but should not be animated every frame.

Use StaticBody2D for

  • TileMap collision
  • Level walls and floors
  • Fixed obstacles
  • Non-moving collision props

Use AnimatableBody2D for

  • Moving platforms
  • Elevators
  • Doors that push characters
  • Scripted kinematic obstacles

Moving platform pattern

moving_platform.gd
extends AnimatableBody2D
 
@export var travel := 220.0
@export var speed := 1.5
 
var start_position: Vector2
 
func _ready() -> void:
    start_position = position
 
func _physics_process(_delta: float) -> void:
    var t := Time.get_ticks_msec() * 0.001 * speed
    position.x = start_position.x + sin(t) * travel
Overlap detection

Area2D

Pickups, checkpoints, sensors, hit zones
Unity habit to replace

This behaves like a Collider2D with isTrigger enabled. It detects bodies and areas but does not block movement.

Pickup trigger

coin_pickup.gd
extends Area2D
 
func _ready() -> void:
    body_entered.connect(_on_body_entered)
 
func _on_body_entered(body: Node2D) -> void:
    if not body.is_in_group("player"):
        return
 
    body.add_coin()
    queue_free()

Continuous damage zone

damage_zone.gd
extends Area2D
 
@export var damage_per_second := 10.0
 
func _physics_process(delta: float) -> void:
    for body in get_overlapping_bodies():
        if body.has_method("take_damage"):
            body.take_damage(damage_per_second * delta)
Common mistakes

Fix these first when physics feels broken

  • Moving a RigidBody2D by setting position every frame instead of using forces, impulses, or a custom integrator.
  • Using Area2D for walls. Areas detect overlaps; they do not block characters.
  • Calling is_on_floor() before move_and_slide(). Floor and wall state is updated by the move call.
  • Putting movement in _process(delta) when it depends on physics collision. Use _physics_process(delta).
  • Forgetting CollisionShape2D nodes. A body without a shape does not meaningfully collide.
Tutor Checkpoint

Lock the pattern in

Before jumping to the next page, turn the idea into one tiny scene or script. That is where the Godot habit sticks.

Unity habit

Rigidbody habits do not map one-to-one to CharacterBody2D.

Unreal habit

Character movement is less prebuilt, but more explicit and scriptable.

Godot habit

Use CharacterBody for controlled actors, RigidBody for simulation, Area for detection.

Try this

Build a collision layer chart for player, enemy, world, trigger, and pickup.

Frequently asked questions

What physics engine does current Godot 4 use?
Godot 4.6+ uses Jolt Physics as the default 3D physics engine for new projects. It offers better performance and stability than the previous GodotPhysics. 2D still uses the built-in physics engine.