# Node not found: "…" (relative to "…") in Godot 4

There is no node at that path relative to the node asking. get_node("Player") on a node with no child named Player prints Node not found: "Player" (relative to "/root/Repro") and returns null. Check the name in the Scene dock and the path from the node running the script; use get_node_or_null() when the node may legitimately be absent.

Source: https://flockbay.com/godot/node-not-found-relative-to/ · Updated 2026-10-30

## What Godot is checking

A relative path is followed from the node that called get_node(): "Player" is a direct child, "UI/Player" a grandchild, "../Player" a sibling. Names are case-sensitive. When a step finds nothing, Node::get_node prints this error with the path and the asking node's absolute path, and returns null.

It is an engine error, not a script error: the script keeps running with null, and the failure usually shows up on the next line, as a call on 'Nil'.

## Reproduce it

A node asking for a child named Player that it does not have.

```
extends Node

func _ready() -> void:
	var player = get_node("Player")
	print(player)

```

## What Godot 4.7.2 prints

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

ERROR: Node not found: "Player" (relative to "/root/Repro").
   at: get_node (scene/main/node.cpp:1975)
   GDScript backtrace (most recent call first):
       [0] _ready (res://answers/node-not-found-relative-to/repro.gd:4)
<Object#null>
```

## Fix it

The same lookup on a scene that has the child, and get_node_or_null() for an optional node.

```
extends Node

func _ready() -> void:
	var player = get_node("Player")
	print(player.name)
	var boss = get_node_or_null("Boss")
	print("boss: ", boss)

```

## What the fixed script prints

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

Player
boss: <Object#null>
```

## 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: "Node not found: "Player" (relative to "/root/Repro").". Find where it comes from and fix it. There is no node at that path relative to the node asking. get_node("Player") on a node with no child named Player prints Node not found: "Player" (relative to "/root/Repro") and returns null. Check the name in the Scene dock and the path from the node running the script; use get_node_or_null() when the node may legitimately be absent. Then run the game headless and check that Godot's output no longer shows it.
```

## The script is on a different node than you think

The path is relative to the node the script is attached to. A script on a child node that asks for $Player looks for a grandchild. Print get_path() to see where the lookup starts.

## An instanced scene that renamed its root

When a scene is instanced, its root takes the name you give the instance. A path written against the original name finds nothing.

## 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: [node.cpp line 1976, the message](https://github.com/godotengine/godot/blob/4.7.2-stable/scene/main/node.cpp#L1976), [Node.get_node_or_null in the class reference](https://github.com/godotengine/godot/blob/4.7.2-stable/doc/classes/Node.xml).

## Questions

### What is the difference between get_node() and get_node_or_null()?

Both return null when nothing is found. get_node() also prints this error; get_node_or_null() stays quiet, for nodes that may not exist.

### Can I use a unique name instead of a path?

Yes. Mark the node Access as Unique Name in the Scene dock and use %Player from any node in the same scene, wherever it sits in the tree.

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: [Invalid access to property or key 'position' on a base object of type 'null instance' in Godot 4](/godot/invalid-access-to-property-or-key-on-null-instance/), [Cannot call method '…' on a null value in Godot 4](/godot/cannot-call-method-on-a-null-value/), [Can't add child '…' to '…', already has a parent '…' in Godot 4](/godot/cant-add-child-already-has-a-parent/), [Parent node is busy setting up children, `add_child()` failed in Godot 4](/godot/parent-node-is-busy-setting-up-children/), [Preload file "…" does not exist in Godot 4](/godot/preload-file-does-not-exist/), [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/)
