![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | andrew.s |
I have a signal called “change_health” defined in a KinematicBody2D (the player):
signal change_health
However, when I want to check if this specific signal exists when a projectile hits it, I get a false result. BUT the signal appears to exist in the .get_signal_list() method.
func _on_Area2D_body_entered(body):
# print(body.name)
# print("Has method:\t %s" % body.has_method("set_health"))
print("Has signal:\t %s" % body.has_user_signal("change_health"))
print(body.get_signal_list())
print("\n")
Here’s the output:
Has signal: False
[{args:[], default_args:[], flags:1, id:0, name:change_health, return:{class_name:, hint:0, hint_strin[...]
The first signal in the list is the “change_health” signal I am looking for, but .has_user_signal returns false. Any explanation on what I could be doing wrong?
same in godot 3.2
pow_n_eed | 2020-02-03 14:32