Questions and Confusion in the "Your First 2D Game" HUD CanvasLayer tutorial

Godot Version



Hello, thanks for reading my absolute beginner question.

The HUD section of the tutorial says to make a CanvasLayer node; I did this, and created the child nodes suggested. But when I got to the part where I am supposed to add script, I find that the script in the CanvasLayer already contains script that matches the main scene. When I change the script in one of these two nodes, it changes the script in the other.

That seems like maybe it’s supposed to be that way, but the debugger won’t let me add the tutorial’s “extends CanvasLayer”, presumably because the main script already has “extends node.”

Am I missing an entire step somehow? I don’t remember learning exactly what “extends” commands do, and I can’t find explanations for how the CanvasLayer is supposed to interact with the Main scene. Based on the tutorial, I thought it should act independently, like the player node and the mob node.

I don’t mind reading through documentation if it’s easier to give me links. I’d be grateful to be pointed in the right direction.

usually thing like this happen, change the extends type to the one you wanted, then also change the node in which you attached the script to to the extends type by right click it and select Change Type, so both matched, but you will see the icon for the node is still not yet changed, you will need to restart your editor to see it changed

Thank you!