Zini
Late reply but would this be the correct way to do it then?
var health = 10
signal health_changed(old_val, new_val)
func _ready():
health_changed.connect(print_health)
take_damage(1)
func take_damage(amount):
var old_health = health
health -= amount
health_changed.emit(old_health, health)
func print_health(old_health, new_health):
print(health)
It does get rid of the "missing arguments" error, but it's still giving me warning. " The parameter "new_health" is never used in the function "print_health()". If this is intended, prefix it with an underscore: "new_health""_
So, i have to put the arguments in the function, but then it doesn't use those arguments...? I don't understand this at all.
Please, someone explain it to me like i'm 5. How do i correctly use arguments with signals?
This has been stumping me for months and i just don't understand what it wants from me...