Godot 4 answers, verified
Each page answers one Godot 4 error, warning or question. Every answer was run headless on the Godot the Flockbay app ships: the script that causes the problem, then the fix, and the output shown is what Godot printed.
22 pages.
- Can Claude Haiku 4.5 write working Godot 4 code? 11 of 15 on the first try
Claude Haiku 4.5 wrote GDScript for 15 Godot 4 tasks and each was run headless on Godot 4.7.2: 11 passed on the first try, 14 after one fix. The code, the errors and the checks.
- Can Claude Opus 5.5 write working Godot 4 code? 15 of 15 on the first try
Claude Opus 5.5 wrote GDScript for 15 Godot 4 tasks and each was run headless on Godot 4.7.2: 15 passed on the first try, 15 after one fix. The code, the errors and the checks.
- Can Claude Sonnet 5.5 write working Godot 4 code? 15 of 15 on the first try
Claude Sonnet 5.5 wrote GDScript for 15 Godot 4 tasks and each was run headless on Godot 4.7.2: 15 passed on the first try, 15 after one fix. The code, the errors and the checks.
- Can GPT-6.1 Sol write working Godot 4 code? 15 of 15 on the first try
GPT-6.1 Sol wrote GDScript for 15 Godot 4 tasks and each was run headless on Godot 4.7.2: 15 passed on the first try, 15 after one fix. The code, the errors and the checks.
- Does Godot use Python? No: GDScript looks like Python, and here is where it is not
Godot's own language is GDScript, not Python. Python code Godot rejects, the same thing in GDScript, and what Godot 4.7.2 printed for both.
- Godot 4.6 to 4.7: every API change, class by class
13 new classes, 529 new methods, properties, signals and constants, 54 removed and 186 deprecated between Godot 4.6 and 4.7, from Godot's own class reference.
- How to wait in Godot 4: "yield" was removed, use await
Godot 4 has no yield. Await a timer's timeout signal instead: the parse error a Godot 3 wait hits, the working version, and what Godot 4.7.2 printed for both.
- Invalid access to property or key on a base object of type 'Nil' in Godot 4
Godot 4 prints this when the variable before the dot holds Nil. A script that causes it, the fix, and what Godot 4.7.2 printed for both.
- Invalid access to property or key on a base object of type 'null instance' in Godot 4
Godot 4 prints this when a node reference points at nothing, usually a $Path or get_node that found no node. The repro, the fix, and Godot 4.7.2's output.
- Invalid access to property or key on a base object of type 'previously freed' in Godot 4
Godot 4 prints this when your variable still points at a node that was freed. A script that causes it, the is_instance_valid fix, and Godot 4.7.2's output.
- Invalid assignment of property or key with value of type on a base object of type 'Nil' in Godot 4
Godot 4 prints this when you set a property on a variable that holds Nil. A script that causes it, the fix, and what Godot 4.7.2 printed for both.
- Invalid call to function '…' in base '…'. Expected N argument(s) in Godot 4
A function was called with fewer or more arguments than it takes. What Godot 4.7.2 checks, the fix, and what it printed for both, verbatim.
- Invalid call. Nonexistent function 'instance' in base 'PackedScene' in Godot 4
Godot 4 renamed PackedScene.instance() to instantiate(). The error a Godot 3 call hits, the fix, and what Godot 4.7.2 printed for both.
- Invalid type in static function '…' in type '…'. Cannot convert argument in Godot 4
A static function got an argument of the wrong Variant type. What Godot 4.7.2 checks, the fix, and what it printed for both, verbatim.
- KinematicBody2D in Godot 4: Could not find base class "KinematicBody2D"
Godot 4 renamed KinematicBody2D to CharacterBody2D and move_and_slide() now takes no arguments. The error a Godot 3 script hits, the fix, and Godot 4.7.2's output.
- setget in Godot 4: Expected end of statement after variable declaration, found "Identifier" instead
Godot 4 removed setget. A Godot 3 setget line fails with Expected end of statement after variable declaration. Both Godot 4 forms, inline and named, run on Godot 4.7.2.
- Spatial in Godot 4: Could not find base class "Spatial"
Godot 4 renamed Spatial to Node3D and its translation to position. The parse error a Godot 3 3D script hits, the fix, and what Godot 4.7.2 printed for both.
- The "export" keyword was removed in Godot 4: every export(...) and its @export annotation
Godot 4 replaced export var and export(...) with annotations. The parse error a Godot 3 script hits, and every export hint as its Godot 4 annotation, run on Godot 4.7.2.
- The "onready" keyword was removed in Godot 4: use @onready
Godot 4 replaced onready var with the @onready annotation. The parse error a Godot 3 script hits, the fix, and what Godot 4.7.2 printed for both.
- The "tool" keyword was removed in Godot 4: use @tool
Godot 4 replaced the tool keyword with the @tool annotation and Engine.editor_hint with Engine.is_editor_hint(). The parse error, the fix, and Godot 4.7.2's output.
- Trying to assign a non-object value to a variable of type '…' in Godot 4
A variable typed with a script class got a String, int or other non-object value. What Godot 4.7.2 checks, the fix, and what it printed for both.
- Trying to call an async function without "await" in Godot 4
A function that uses await was called and its return value used without await. What Godot 4.7.2 checks, the fix, and what it printed for both, verbatim.
