0 votes

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?

in Engine by (67 points)

Are you worried about the warnings that the editor prints out? If so, you can safely ignore them.

1 Answer

0 votes

you can use following

# warning-ignore:unused_argument

at top of a function and you get no warnings from this.

# warning-ignore:unused_argument
func _physics_process(delta):
by (85 points)

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:


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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.