Godot 4.3
Is there more elegant way to deal with “The signal “signal_name” is declared but never explicitly used in the class” warning for global script (used as signalbus) vs just ignoring warning
Godot 4.3
Is there more elegant way to deal with “The signal “signal_name” is declared but never explicitly used in the class” warning for global script (used as signalbus) vs just ignoring warning
Thanks. Yes i am fully aware i can ignore warning. Problem is warning would makes sense in some cases when you can actually forget to use signal, but you shouldn’t get warning in cases like doing signal bus
You can use @warning_ignore("warning_id")
to ignore a warning from one specific line, but of course it gets tedious to do for each signal, and clutters the script. Idk if there’s a way to disable a warning for an entire script, but not other scripts.
@warning_ignore(unused_signal) is what i currently went for
I don’t know how your signals works, but why don’t make functions and call them from them?
I did not try it in a global script, but in regular scripts the way to go is substitute the syntax (valid without warnings) until v. 4.2
signal <signal_name>
[…]
emit_signal(<signal_name>)
with the v. 4.3 syntax
<signal_name>.emit()
Declaration stays the same, parameters can be passed as a comma separated list inside the parentheses.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.