I'm fairly new to Godot and so for my first real project I'm working on a tower defense game. I've run into a bit of a snag though, I'm trying to use a signal to update the health of your "crystal" when an enemy reaches it but the signal can't seem to find the function I've connected it to in my ui.
In my crystal script I've got two functions:
onready var health_bar = get_node("/root/Main/CanvasLayer/GUI/HBoxContainer/Bars/LifeBar")
connect("crystal_damaged", health_bar, "_on_crystal_damaged")
hp -= value
And in my LifeBar script I've got:
The connect call seems to work (returns 0) but then when I try to run emit_signal, I get
Error calling method from signal 'crystal_damaged': 'HBoxContainer::_on_crystal_damaged': Method not found.
I've already checked that the get_node at the top works, the signal name is the same in all three places and the function name matches between scripts (I even copied it directly just to be sure) but still no luck.
Unfortunately I have to do this through scripting since I'm adding the crystal through scripting.
I'm at a total loss here, is this a bug or am I missing something really obvious?