RigidBody in Godot 4: it is RigidBody3D now
By Eduardo Orellana · Updated
RigidBody is called RigidBody3D in Godot 4, and its mode property is gone: freeze and freeze_mode replace MODE_STATIC and MODE_KINEMATIC. In a Godot 4 project, extends RigidBody fails to parse with Could not find base class "RigidBody".
AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.
Intel or AMD Chromebook, with Linux turned on.
What Godot is checking
GDScript resolves the class after extends when the script loads. RigidBody is not a class in Godot 4, so the script fails to parse and nothing in it runs.
The converter carries RigidBody to RigidBody3D. A body Godot 3 put in MODE_STATIC is a RigidBody3D with freeze = true; MODE_CHARACTER is lock_rotation = true. Godot 3's apply_impulse(position, impulse) takes the impulse first in Godot 4: apply_impulse(impulse, position).
Reproduce it
A Godot 3 script that extends RigidBody, in a Godot 4 project. The scene is one Node carrying it.
extends RigidBody
func _ready():
print("ready")
What Godot 4.7.2 prints
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
SCRIPT ERROR: Parse Error: Could not find base class "RigidBody".
at: GDScript::reload (res://answers/rigidbody-in-godot-4/repro.gd:1)
ERROR: Failed to load script "res://answers/rigidbody-in-godot-4/repro.gd" with error "Parse error".
at: load (modules/gdscript/gdscript_resource_format.cpp:46)Fix it
A RigidBody3D frozen, then released with an impulse.
extends RigidBody3D
func _ready() -> void:
freeze = true
print(get_class(), " frozen: ", freeze, ", mode: ", freeze_mode == RigidBody3D.FREEZE_MODE_STATIC)
freeze = false
apply_central_impulse(Vector3(0, 5, 0))
print("lock rotation: ", lock_rotation)
What the fixed script prints
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
RigidBody3D frozen: true, mode: true
lock rotation: falseVerified on Godot 4.7.2
Both scripts on this page were run headless on Godot 4.7.2 (4.7.2.stable.mono.official.ed1daf0bf) on 18 October 2026, and the output above is what Godot printed, unedited.
Where the check lives in Godot's source: [renames_map_3_to_4.cpp line 1588, RigidBody to RigidBody3D](https://github.com/godotengine/godot/blob/4.7.2-stable/editor/project_upgrade/renames_map_3_to_4.cpp#L1588), [RigidBody3D class reference](https://github.com/godotengine/godot/blob/4.7.2-stable/doc/classes/RigidBody3D.xml).
Questions
- How do I move a RigidBody3D directly?
- Freeze it with freeze_mode FREEZE_MODE_KINEMATIC and move it, or apply forces; setting position on a moving body fights the physics.
- What is the 2D version?
- RigidBody2D, which made the same change from mode to freeze.
Related
- KinematicBody in Godot 4: it is CharacterBody3D now
- StaticBody in Godot 4: it is StaticBody3D now
- Every verified Godot 4 answer
- How to get collisions after move_and_slide() in Godot 4
- Spatial in Godot 4: Could not find base class "Spatial"
- Reference in Godot 4: it is RefCounted now
- Area in Godot 4: it is Area3D now
- Camera in Godot 4: it is Camera3D now
Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.
Download Flockbay free