![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Aww_Blackmist |
New to Godot as well as programming, trying to create a simple stamina system.
var points = 1
func _physics_process(_delta):
if.Input.is_action_pressed("attack") && points == 1:
attack.set_frame(0)
attack.play()
func _attack_on_animation_finished():
points = points - 1
timer.start()
func _on_timer_timeout():
points = points + 1
The idea is simple, i want to only attack when there is a point left. Its like a stamina and should be consumed if an attack is made. So i reduced the point when the attack is made and started a timer of 1 sec. when the timer runs out the points is back. but the variable is not updating. please help. is there anyother good idea for a stamina system or what am i doing wrong??