How should I fix the error in AGM: [ImageGauge] target object not found. [ res://sampleobject/Object_Sampleplayer.tscn ]?

After following the official tutorial [Tutorial: Script Course #4 — Let’s Create a UI] to create the health bar, the project outputs an error every time it is run:


The error is: [ImageGauge] target object not found. [ res://sampleobject/Object_Sampleplayer.tscn ].
[ImageGauge] target object not found. [ res://sampleobject/Object_Sampleplayer.tscn ].

However, as soon as I delete the ImageGauge node corresponding to the health bar UI, the project runs normally without errors. But as soon as I restore that node, the error reappears. What is causing this? The object settings should be correct according to the tutorial. Is there an issue with the settings shown in the image? Or is there another reason?

Is there a minimal project available for analysis that can directly reproduce the issue?

I am having the same error after following the tutorial and the hp bar does not display at all when testing the game scene.

I had an error too. For some reason it went away after I changed the ‘hp’ variable to something else and tried to playtest. I then changed it back to ‘hp’ and it worked. Can you see if that works?

I wonder if the default ‘hp’ id is getting stuck on initialization. :thinking:

It is also strange that the object_id is not one of the options on the variable id until you get off hp and then try to select again. I think the variable id enum is initializing incorrectly.

1 Like

Thank you! That did indeed seem to clear the first error and restore functionality however it throws out a new error. Fortunately the new error does not seem to hinder any functionality.

This is not a concern for me at the moment but I probably fiddle with it later. Just posting in case it helps.