![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | pferft |
Hi everyone,
within a TimerNode
I just managed to set up some calculations considering the current time and a user-entered time and it prints the right numbers:
var result_for_wait_time
func _on_that_button_pressed():
# ...getting some numbers and do calculations...
result_for_wait_time = entered_time_in_secs - current_time_in_secs
print (result_for_wait_time)
So this works. Now I want the result to be put into the following
func _ready():
set_wait_time(result_for_wait_time)
so my parent LabelNode
displays some countdown. This is all set up and working fine with a number entered directly, like for example set_wait_time(100)
, but replacing the 100
with result_for_wait_time
throws me the error
Invalid type in function 'set_wait_time' in base 'Timer (TimerScript.gd)'. Cannot convert argument 1 from Nil to float.
I have the feeling that I’m missing some rather simple little thing… how can I get my calculation results in there?