system
August 21, 2019, 10:39am
1
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
gruen
well I am creating timer in my code and everytime i get following message:
The function ‘connect()’ returns a value, but this value is never used
so now i have 7 timers and i get this message 7 times already.
i know in a function i need to set a low line “_” to avoid that message, if i know i dont need the argument.
is there a way to do so in the create_timer function also?
Are you worried about the warnings that the editor prints out? If so, you can safely ignore them.
Ertain | 2019-08-21 11:03
system
August 22, 2019, 5:26pm
2
Reply From:
Holm
you can use following
# warning-ignore:unused_argument
at top of a function and you get no warnings from this.
Example:
# warning-ignore:unused_argument
func _physics_process(delta):
...
thank you, i dont know why but that didnt worked for me. maybe i didnt use it in the right way. annyway i could get off that warnings bei creating an function to shorten the timer creating:
for
get_tree().create_timer( seconds ).connect( "timeout", self, "anyFunction")
i did that:
func alarm (seconds, where, funktion):
return (get_tree().create_timer(seconds).connect("timeout",where,funktion))
I dont know why, but in this case there aren’t warnings spawning annywere
bad english for my sorry