Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | imekon | |
Old Version | Published before Godot 3 was released. |
Once I’ve used a tween, how do I use it again?
I’ve got two tweens set up to fade out a label and fade in a label. However, once I’ve used them, they don’t work again. I tried calling reset, but that had no effect.
func _ready():
tweenOut.interpolate_property(label, "visibility/opacity", 1.0, 0.0, 3.0, Tween.TRANS_QUAD, Tween.EASE_OUT)
tweenIn.interpolate_property(label, "visibility/opacity", 0.0, 1.0, 3.0, Tween.TRANS_QUAD, Tween.EASE_IN)
func _onFadeOut():
tweenOut.reset(label, "visibility/opacity")
tweenOut.start()
func _onFadeIn():
tweenIn.reset(label, "visibility/opacity")
tweenIn.start()
I’ve put the code here: https://github.com/imekon/godot-unofficial-demo-projects/tree/master/TweeningIt