@onready var stamreg_timer = $"Stam Timer"
var regen : int = 0
# Checks if pressing Shift/Run button.
if Input.is_action_pressed("Run") and input_dir.y < 0 and can_run == true:
run_speed = 1.75
stamina -= ceil(2 * delta)
print("Stamina: " + str(stamina))
else:
run_speed = 1.0
stamreg_timer.start()
regen = 0
func _stamina_reg_timer():
regen = 1
print("Regenerate stamina")
For some reason a my timer is not working. When the player stops holding the run button the timer should start, but no matter what the timer will just never start.