Godot "your first 2D game" : node not found

Godot Version

4.2.1

Question

I wanna try to make “your first 2D game”
I finished my project until Heads up display

before entering the section “removing old creeps”, I faced to the problem.
when I try to play the project, I can find the error such as ‘show_message():Node not found: MessageTimer(relative to~)’

How can I solve this problem.
Thank you so much

this will give the same error

func _ready():
	print($doesnt_exist)

make sure that HUD.tcsn has all of its children in your main.tscn

can you please specify on how to add all HUD.tcsn children into main.tscn because I’m currently having the same problem and cannot figure out how to solve it.
thanks!

They did not implement this warning, which has worse side effects not listed.

Remember to remove the call to new_game() from _ready() if you haven’t already, otherwise your game will start automatically.

If you instantiate the HUD.tscn scene it will have all of it’s children, that’s unlikely to be the issue.

2 Likes

Does your main scene tree look like this?
https://docs.godotengine.org/en/stable/_images/completed_main_scene.webp

1 Like


yes, here is a screenshot incase i missed something.

the menu itself opens fine but once i press the start button I’m hit with the error:
“hud.gd:36 @ update_score(): Node not found: “ScoreLabel” (relative to “/root/Main/HUD”).”

Necroing this because I too have the same issue and could only find one other post about this issue here but could not figure out a solution. If anyone was able to figure this out it would be really helpful to me.

Okay so I figured out my issue and it was a dumb typo issue. I had copied the code from the tutorial verbatim and it had $HUD.update_score(score) for example but I named my hud “Hud” instead of “HUD” with all caps so it wasnt finding it because it wasnt spelled correctly. Looking at OP’s error message it looks like they named their hud in all uppercase, but made the call typed out in lowercase as shown below