system
1
|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
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?
system
2
|
|
|
|
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:. SORRY FOR LATE REPLY.
Jan Gabriel | 2022-04-30 07:15
system
3
|
|
|
|
Reply From: |
Ninfur |
You can disable the warning in the project settings