0 votes

im using this code to start timer with latency that announced in var "attackSpeed"

var _timer = null
var duration = 4
func _ready():
    _timer = Timer.new()
    _timer.connect("timeout", self, "_on_Timer_timeout")
    _timer.set_one_shot(false) # Make sure it loops
func _on_Timer_timeout():

then i created a button which has to decrease duration var with 1

  func _on_Button3_pressed():
        duration -= 1

and how to make timer changing by 1 while it running?

Godot version Godot_v3.4.4-stable_x11.64
in Engine by (24 points)

1 Answer

0 votes

actually just found by myself
add to the button click

func _on_Button3_pressed():
    duration -= 1
by (24 points)
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.