Godot Version
4.2.1
Question
I’m trying to create a tween animation for UI where a banner drops from the top of the screen and then does a bounce in place.
func _ready():
banner_drop()
func banner_drop():
var tween = create_tween()
tween.tween_property(banner, "position:y", 400, 3).set_trans(Tween.TRANS_BACK).set_ease(Tween.EASE_OUT)
tween.tween_callback(banner_bounce)
func banner_bounce():
var tween = create_tween().set_loops()
tween.tween_property(banner, "position:y", -30 , 2.0).as_relative().set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN_OUT)
tween.tween_property(banner, "position:y", 30 , 2.0).as_relative().set_trans(Tween.TRANS_QUAD).set_ease(Tween.EASE_IN_OUT)
It works for the most part but there’s a slight pause between one tween and the other. I included a video showing the ~1 second transition between the first function and the second. Is there a way to seamlessly go from one to the other?
Alternatively, is there a way to set_loops() for only a determined number of steps in the tween instead of the whole thing? This is the reason I used two different functions.