This Sprite is meant to appear right below the viewport, out of sight, then use the Tween node to go to the top once Activate() is called.
extends Sprite
var screen_size
func _ready():
screen_size = get_viewport_rect().size
position.y = screen_size.y
Activate(screen_size.y)
func Activate(screen):
var tween = $Tween
var target = position.y - screen
tween.interpolate_property(self, "position", position.y, target, 1, Tween.TRANS_LINEAR, Tween.EASE_OUT)
if not tween.is_active():
tween.start()
There are no error messages or anything, it just doesn't animate.
I've checked the values used by the tween and they seem to be exactly what I want.
Is there something about how tweens or get_viewport_rect()
work that I'm missing?