0 votes

I was trying to do something and for some reason the timers don't work if the if testament is checking numbers or true/false, does anyone know how to fix this or why is this happening?

extends Node2D

var woooh = 1

func _process(_delta):

  if woooh >= 3:
     $Timer.start()

  if Input.is_action_just_pressed("ui_accept"):
     woooh += 1
     print (woooh)

func timeout():
  print ("lol")
Godot version v3.4.2
in Engine by (12 points)

1 Answer

0 votes

In order to detect when the Timer ends, you need to connect the Timer's timeout signal.

In your code you just defined a timeout() function that is never called.

Examples in the docs here:
https://docs.godotengine.org/en/stable/getting_started/step_by_step/signals.html

by (21,714 points)

They are connected

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.