Error Calling method from signal ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By wildboar

Probably a silly mistake on my part but I can not figure out why this happens now…

emit_signal: Error calling method from signal 'attack_started': 'Sprite('::_on_RangedWeapon_attack_started': Method not found...

On I have signal attack_started and signal attack_finished, and they are called using emit_signal…

And they are connected in RangedWeapon scene via editor. On which extends (which extends…

Can the issue come from duplicating the weapon, using .duplicate() ?

:bust_in_silhouette: Reply From: Inces

Quite possible.
What error means is that object being signaled lacks method to " hear signal ". Yours name is _on_ranged_weapon_attack_started(). I guess You succesfully implemented it in script or didn’t change the name of connection default method.
After duplicating it still should be in duplicated script, but maybe something went off. Try to debug this error by connecting things via code, in ready() or init().

Thank you, connecting in code on ready function fixed it.

wildboar | 2021-02-28 15:25