# 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.

Source: https://flockbay.com/godot/nonexistent-function-in-base-nil/ · Updated 2026-10-30

## 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.

## 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.

```
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

jumped
```

## 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.

```
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.

## 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.

## 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).

## 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.

Download Flockbay free: Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot. https://flockbay.com/download/

Related: [Cannot call method '…' on a null value in Godot 4](/godot/cannot-call-method-on-a-null-value/), [Invalid access to property or key 'position' on a base object of type 'Nil' in Godot 4](/godot/invalid-access-to-property-or-key-on-nil/), [Cannot call method '…' on a previously freed instance in Godot 4](/godot/cannot-call-method-on-a-previously-freed-instance/), [Invalid operands 'Nil' and 'int' in operator '+' in Godot 4](/godot/invalid-operands-nil-and-int/), [Unable to iterate on object of type 'Nil' in Godot 4](/godot/unable-to-iterate-on-object-of-type-nil/), [Every verified Godot 4 answer](/godot/), [How do I see Godot’s output and errors in Flockbay?](/docs/how-do-i-see-godots-output-in-flockbay/)
