If main scene is game level then use Node instead of Node2D.
Why do you want to have HUD as a child of Canvas layer, is there any reason?
....I would use Control node and label node as his child.
...then in Node( main scene) create script then get label in script by
var score_count = $label
or in your case var score_count = $CanvasLayer/Control(use Control node!)/label
Then with Area2D coin you created a signal bodyentered....connect this signal
function _onArea2Dbodyentered() will be created in mainscene(root node) script.
script for Node (mainscene.gd)
extends Node
onready var score_count = $label
var coin = int(0)
var coin_hit = bool (false)
func _ready():
score_count.set("text", str(coin))
func _process(delta):
if coin_hit == true:
coin = +1
score_count.set("text", str(coin))
func _on_Area2D_body_enter():
coin_hit = true
....the solutions is more...download the documentation in pdf and search there