Should I leave warnings alone?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Jan Gabriel

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?

:bust_in_silhouette: Reply From: joeyq

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
	#print(bullet_spawned)

Yes ty it works also​:smiling_face::smiling_face:. SORRY FOR LATE REPLY.

Jan Gabriel | 2022-04-30 07:15

:bust_in_silhouette: Reply From: Ninfur

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