Removing unused method with reference to preload causes project to burn

Godot Version

4.3

Question

I have a method that is no longer used get_tooltip_node. When I remove this method from the code, my project stops working. I get a lot of errors like this: referenced non-existent resource and could not resolve
The method returns a reference to CommonNodes.GearHoverTooltip which is a preload const GearHoverTooltip = preload("res://scenes/ui/inventory/gear/GearHoverTooltip.tscn")

I suspect it is related to a circular reference or something. That’s what I checked in all my changed files. But removing something should not create a circular reference, to my understanding?

I tried deleting my .godot-Cache. No effect.

Can anyone give an explanation what the issue could be here?

See this video:

Open your TSCN as text files (NPC.tscn on line 10, WanderingNPC.tscn on line 20) and check what are the broken references. This will get you started on tracking the issue

1 Like

So I go into Character.tscn, and then? There’s no way to go. These files have no errors and all run fine, if only I keep that method in. As described.

If I change the preloads inside Realm.gd to loads, then it works. Should be an engine bug.

Open the tscn in an external text editor, not Godot.

I’m in VSCode.

Does your Realm class make use of the get_tooltip_node function?

The method is not used at all.

I restarted the engine and got another error message that lead me to these issues

Should be an engine bug which you can avoid by not using preloads (when you get this brutal bug).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.