Node Path Refactor | Godot 4.2+ Addon
A downloadable addon
Node Path Refactor
Rename a node. This fixes everything you just broke.
Godot's editor rewrites the .tscn when you rename a node. It does not touch
your scripts. So the moment you rename Player to Hero, all of this silently
becomes a runtime crash:
@onready var sprite = $Player/Sprite
@onready var bar = get_node("Player/HealthBar")
@export var target: NodePath = NodePath("../Player/Sprite")
No warning at save time. No error in the editor. You find out when the game runs — or when a player does.
What it does
It builds a real index of every node in every scene, resolves every reference against the actual tree, and tells you exactly which ones are broken. Then it rewrites them correctly.
Press Rescan project and you get one row per reference:
- ok — resolves to a real node
- BROKEN — resolves to nothing, with suggested replacements
- partial — fine in some scenes, broken in others
- unknown — runs through an instanced sub-scene, so it can't be verified
- no scene — the script isn't attached to a scene, so nothing can be checked
Click any row to jump straight to that line in the script editor.
Why it isn't find-and-replace
Because find-and-replace gets this wrong.
These two lines are identical text, and they both mean Player/Sprite:
# written on the Player node
@onready var a = $"../Player/Sprite"
# written on the HUD node
@onready var b = $"../Player/Sprite"
After you rename Player to Hero, the first should become $"Sprite" — the
node moved underneath the script. The second should become $"../Hero/Sprite" —
nothing moved, only the name changed.
A text replace rewrites both the same way, and one of them ends up wrong. This tool resolves each reference to an absolute scene path first, then recomputes the relative path from the new owner. That's the whole trick, and it's why this isn't a grep wrapper.
What it rewrites
$Player/Spriteand$"Player/Sprite"
%HealthBarscene-unique names
get_node(),get_node_or_null(),has_node()
NodePath(...)in scripts and in.tscnfiles
[connection from="Player" to="."]signal connections
What it deliberately won't touch
- Absolute
/root/...tree paths. Those follow a different rule, and guessing wrong silently corrupts working code — so they're reported asunknowninstead.
find_child()andfind_parent(). Those take wildcard patterns, not paths.
- Node names inside plain strings.
"Player"on its own is not a reference.
- Anything inside a comment or a string literal. The scanner is a real
tokenizer, not a regex pile, so
"%d" % valueand# $Playernever trigger a hit.
A tool that cries wolf gets uninstalled. Avoiding false positives is the point.
Safe by default
- Every file is backed up to
user://node_path_refactor_backups/<timestamp>/before a single byte changes
- Preview shows the full diff of every edit before you commit anything
- Restore backup puts everything back with one click
- Scene-scoped by default — you choose whether a rename applies to one scene or the whole project
Install
- Unzip into your project root — the folder that contains
project.godot, not intoaddons/. The zip already contains theaddons/level, so it merges with your existing one. You should end up with:
If you seeaddons/addons/node_path_refactor, you unzipped one level too deep. Move the inner folder up a level and delete the duplicate.
- Project → Project Settings → Plugins → Enable
- The dock appears as a tab next to Inspector — click it
The folder must stay namednode_path_refactor. Godot resolves addon script paths statically (res://addons/node_path_refactor/...), so renaming it breaks the addon silently — the plugin just won't show up in the list. That's normal for Godot addons, not a quirk of this one.
Requires Godot 4.2+. MIT licensed: use it at work, fork it, ship it in a commercial game, whatever. Credit is appreciated but not required
Try it before you install it
The second download is a complete Godot project with the addon already installed and two deliberately broken references in it. Open it, press Rescan project, and you'll see exactly what you're getting before you touch your own codebase.
Known limitations
- GDScript only — C# scripts are not scanned
- Paths that run through an instanced sub-scene are reported as
unknown, not verified (the tool can't see inside a scene it hasn't loaded)
- Absolute
/root/...paths are not rewritten
- Node names containing
/or"are not handled
Found a bug, or a reference it misses? Leave a comment. Every false positive is a bug, and I'd rather hear about it.
| Updated | 1 day ago |
| Published | 2 days ago |
| Status | Released |
| Category | Tool |
| Author | Sphinx dev |
| Made with | Godot |
| Tags | addon, editor-plugin, gamedev, gdscript, Godot, godot-4, productivity, refactoring, tool, workflow |
| Code license | MIT License |
| Asset license | Creative Commons Attribution v4.0 International |
| AI Disclosure | AI Assisted, Code |
Download
Click download now to get access to the following files:



Leave a comment
Log in with itch.io to leave a comment.