In the script you provided this is true because you never actually call b()
, e.g.:
func _ready():
b()
However, even if you do this, the warning won't be gone. But it will work:
signal test()
func _ready():
connect("test", self, "_on_test")
b()
func b():
c("test")
func c(s):
emit_signal(s)
func _on_test():
print("It works")
But why the warning then? Because the GDScript parser won't recognize that you actually do emit the signal, albeit using a variable argument. Try this:
func c(s):
match s:
"test":
emit_signal("test")
If that's no option for you, you can also disable the warning under Project > Project Settings... > Debug > Gdscript > Unused Signal or add an exception with:
#warning-ignore:unused_signal
signal test()