Invalid call. Nonexistent function '…' in base 'Nil' in Godot 4
The variable you called the method on is null. player.jump() with player never assigned stops with Invalid call. Nonexistent function 'jump' in base 'Nil'. Assign it before the call, usually with @onready var player = $Player, and check the node path is right.
AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.
Intel or AMD Chromebook, with Linux turned on.
What Godot is checking
Calling a method on an untyped variable looks the method up on whatever the variable holds at that moment. null has no methods, so the VM reports the call as a nonexistent function with base 'Nil', the type of null.
Through a variable typed as a class, var player: Node2D, the same call prints Cannot call method 'jump' on a null value instead.
More on this: Invalid access to property or key 'position' on a base object of type 'Nil' in Godot 4
Reproduce it
A player variable declared but never assigned, then called.
extends Node
var player
func _ready() -> void:
player.jump()
print("after")
What Godot 4.7.2 prints
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
SCRIPT ERROR: Invalid call. Nonexistent function 'jump' in base 'Nil'.
at: _ready (res://answers/nonexistent-function-in-base-nil/repro.gd:6)
GDScript backtrace (most recent call first):
[0] _ready (res://answers/nonexistent-function-in-base-nil/repro.gd:6)Fix it
Assign the variable from the scene before calling it. The scene here has a Player child.
More on this: Invalid assignment of property or key 'text' with value of type 'String' on a base object of type 'Nil' in Godot 4
extends Node
@onready var player = $Player
func _ready() -> void:
player.jump()
What the fixed script prints
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
jumpedRun 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.
My Godot 4 project prints this error: "Invalid call. Nonexistent function 'jump' in base 'Nil'.". Find where it comes from and fix it. The variable you called the method on is null. player.jump() with player never assigned stops with Invalid call. Nonexistent function 'jump' in base 'Nil'. Assign it before the call, usually with @onready var player = $Player, and check the node path is right. Then run the game headless and check that Godot's output no longer shows it.A node path that finds nothing
@onready var player = $Player is null when there is no child named Player, and Godot prints Node not found: "Player" first. Check the name and the path in the Scene dock: $Player looks for a direct child, $UI/Player for a grandchild.
Calling it before _ready()
An @onready variable is assigned just before _ready(). A call from _init(), or from another node's _ready() that runs first, finds it still null.
More on this: Invalid access to property or key 'position' on a base object of type 'null instance' in Godot 4
The same error in earlier Godot versions
Godot 3.6 printed it as: Attempt to call function 'jump' in base 'null instance' on a null instance. The cause and the fix are the same.
More on this: Invalid call to function '…' in base '…'. Expected N argument(s) in Godot 4
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 18 October 2026, and the output above is what Godot printed, unedited.
Where the check lives in Godot's source: gdscript_vm.cpp line 163, the message, gdscript_vm.cpp lines 62 to 80, how the base type is named.
Questions
- Is this the Godot 4 version of 'Attempt to call function in base null instance'?
- Yes. Godot 3.6 printed Attempt to call function 'jump' in base 'null instance' on a null instance. for this call; Godot 4.7.2 prints Nonexistent function in base 'Nil' through an untyped variable.
- Why does it say the function does not exist when it does?
- It does not exist on null. The function is on the node you meant to call; the variable holds null instead.
Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.
Download Flockbay free