hey guys !
Im working on a tower defense and im working on the "frost tower".
The frost tower apply a slow to the unit and not stack. It works great !
But, when the unit is hit again by a frost tower, i want to update the current timer.
I used setwaittime(effect_time) but it doesn't work...
I was wondering if one of you had an idea on how to adapt my script to make it work ?
Here is my function effect()
if effect_frost == 0:
#Set the speed minus effect_amount %
var slow_amount = (speed * effect_amount) / 100 # make that # into a number
speed -= slow_amount #update the speed of unit
effect_frost = 1 #This unit is now frosted.
#Start timer to turn it off when it's done.
$Timer_frost.connect("timeout",self,"slow_effect_done", [slow_amount])
$Timer_frost.set_wait_time(effect_time+1)
$Timer_frost.start()
else: #He is already frost, let's just restart the timer with effect_time.
$Timer_frost.set_wait_time(effect_time) # trying to update the current timer.
print("Already frosted")
print($Timer_frost.get_time_left())
Oh and on timeout sloweffectdone, i stop the timer and set the effect_frost to 0.
any idea why/how to update the current timer ?
Thx !