+2 votes

The function 'connect()' returns a value, but this value is never used.

I always get this warning, but I intended it to happen. What do I do with it?

in Engine by (44 points)

2 Answers

+6 votes
Best answer

You can disable the warning in the project settings
enter image description here

by (1,047 points)
selected by
+3 votes

You don't have to do anything with it, but I always use _x for a throwaway variable.
for example a timer for a weapon shooting.

## timer node
onready var timer: Timer = $"CoolDownTimer"

func _ready():
    var _x:int = 0
    _x = timer.connect("timeout", self, "_on_timeout")
    timer.one_shot = true
    timer.wait_time = 0.1

func _on_timeout():
    can_shoot = true
by (117 points)

Yes ty it works also☺️☺️. SORRY FOR LATE REPLY.

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.