Invalid call. Nonexistent function '…' in base 'Nil' in Godot 4
By Eduardo Orellana · Updated
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 on a base object of type 'Nil' in Godot 4
Reproduce it
A player variable declared but never assigned, then called.
More on this: Invalid call to function '…' in base '…'. Expected N argument(s) in Godot 4
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.
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
jumpedA 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.
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 access to property or key on a base object of type 'null instance' 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](https://github.com/godotengine/godot/blob/4.7.2-stable/modules/gdscript/gdscript_vm.cpp#L163), [gdscript_vm.cpp lines 62 to 80, how the base type is named](https://github.com/godotengine/godot/blob/4.7.2-stable/modules/gdscript/gdscript_vm.cpp#L62-L80).
More on this: Invalid assignment of property or key with value of type on a base object of type 'Nil' in Godot 4
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.
Related
- Cannot call method on a null value
- Node not found: "…" (relative to "…")
- Every verified Godot 4 answer
- Invalid access to property or key on a base object of type 'null instance' in Godot 4
- Invalid access to property or key on a base object of type 'Nil' in Godot 4
- Invalid assignment of property or key with value of type on a base object of type 'Nil' in Godot 4
- Invalid operands 'Nil' and 'int' in operator '+' in Godot 4
- Invalid call. Nonexistent function 'instance' in base 'PackedScene' in Godot 4
Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.
Download Flockbay free