Skip to content

Spatial in Godot 4: Could not find base class "Spatial"

By Eduardo Orellana · Updated

Spatial is called Node3D in Godot 4, and its translation property is position. A Godot 3 script that extends Spatial fails to parse with Could not find base class "Spatial"; extend Node3D and use position, or global_position for the position in the world.

AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.

Intel or AMD Chromebook, with Linux turned on.

Download for macOSDownload for WindowsDownload for Linux

What Godot is checking

When GDScript loads a script it resolves the class after extends. Spatial is not a class in Godot 4, so the script fails to parse and none of it runs.

Godot 4 renamed the 3D base node to Node3D, and most 3D nodes took a 3D suffix with it: MeshInstance is MeshInstance3D, Camera is Camera3D, Area is Area3D. Its 3-to-4 converter carries Spatial to Node3D and translation to position in its renames table.

More on this: Godot 3 to Godot 4: the converter, then the errors it leaves

Reproduce it

A Godot 3 3D script in a Godot 4 project. The scene is one Node3D with this script.

GDScript
extends Spatial

func _ready():
	translation = Vector3(1, 2, 3)
	print(translation)

What Godot 4.7.2 prints

Output
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org

SCRIPT ERROR: Parse Error: Could not find base class "Spatial".
   at: GDScript::reload (res://answers/spatial-in-godot-4/repro.gd:1)
ERROR: Failed to load script "res://answers/spatial-in-godot-4/repro.gd" with error "Parse error".
   at: load (modules/gdscript/gdscript_resource_format.cpp:46)

Fix it

Extend Node3D and set position. global_position is the position in the world, which Godot 3 code read from global_transform.origin.

GDScript
extends Node3D

func _ready() -> void:
	position = Vector3(1, 2, 3)
	print("position ", position, ", global_position ", global_position)

What the fixed script prints

Output
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org

position (1.0, 2.0, 3.0), global_position (1.0, 2.0, 3.0)

Run this fix with your agent

Flockbay is the Godot editor with an AI agent built in. Paste this into Flockbay's chat, or into Claude Code or Codex connected to Flockbay over MCP: the agent finds the cause in your project, applies the fix, runs the game headless and reads Godot's output to check it.

More on this: Area in Godot 4: it is Area3D now

Prompt
My Godot project was written for Godot 3 and Godot 4 stops on this: "Parse Error: Could not find base class "Spatial".". Port every use to Godot 4. Spatial is called Node3D in Godot 4, and its translation property is position. A Godot 3 script that extends Spatial fails to parse with Could not find base class "Spatial"; extend Node3D and use position, or global_position for the position in the world. Then run the game headless and check Godot's output for errors.

Verified 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 6 October 2026, and the output above is what Godot printed, unedited.

Where the check lives in Godot's source: gdscript_analyzer.cpp line 572, the message, renames_map_3_to_4.cpp line 1595, Spatial to Node3D, renames_map_3_to_4.cpp line 1169, translation to position.

Questions

Where did rotation_degrees and scale go?
They kept their names on Node3D: rotation_degrees, rotation and scale. The property that changed name is translation, now position.

Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.

Download Flockbay free