I'm using a timer to limit how long a missile exists. I want to be able to adjust this based on the quality of the weapon used.
scene structure is area2d/timer.
code:
extends Area2D
var vel = Vector2()
var pos = Vector2()
func _ready():
$range_timer.wait_time = world.missile_stats["range"]
print( str($range_timer.wait_time) )
func _on_range_timer_timeout():
queue_free()
This does print out the waittime I set, but the missile lives for the amount of time that is set in the GUI's node inspector.
I have also tried to adjust with a local variable and fixed float/int values, tried setting the node inspector value to 0.0 and tried the older code of .setwait_time() (which is not valid code any more.)