Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | yeeshu06 | |
Old Version | Published before Godot 3 was released. |
Help needed. Cant use tween, doesnt work. thanks. Help needed asap. Thanks
Can you show me your code ?
Skyfrit | 2017-08-21 15:09
This is the tween variable declared in beginning, and Tween as in Node is added under Progressbar Node :
onready var tween = get_node("Tween")
This is the code for changing color that i found on questions.
if time > 0 && time <= 25:
#Attempt to change color of progress bar as time goes below 25 seconds
tween.interpolate_method(get_node("Control/ProgressBar").get("custom_styles/fg"), "set_bg_color", Color("0081ff"),
#Color("ffffff"), 1, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
#tween.start()
This is the code that i put in the time constraint, in so the color changes as time in progress bar goes under 25. Thanks.
yeeshu06 | 2017-08-21 15:18
Did the tween node connect to tween_step signal ?
Skyfrit | 2017-08-21 15:27
I dont think it does. When time strikes 25, this error pops up.
Attempt to call function 'interpolate_method' in base 'null instance' on a null instance
yeeshu06 | 2017-08-21 15:30
That means it can’t find the Tween node.
You need to give the correct NodePath.
onready var tween = get_node(“Tween”)
Skyfrit | 2017-08-21 15:44