0 votes

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?

Godot version Godot 3.2.3
in Engine by (15 points)

1 Answer

0 votes
Best answer

You want to animate "position:y", not "position".

by (8,546 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.