Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Jerkycat |
I’m making a top down shooter, based on some older tutorials, i tried adding a timer, so the character may not constantly shoot without a cooldown.
So i have created a timer node, and conected it to the character, but it simply does not work.
> if Input.is_action_pressed("Shoot") and Global.criacao_no_pai != null:
> > Global.instance_node(projectile, global_position, Global.criacao_no_pai)
> > reloaded = false
> > $reload_time.start()
func _on_reload_time_timeout() -> void:
> reloaded = true
The timer node is called “reload_time”, i also have the the variable for reloaded as
var reloaded = true