0 votes

There's a control that I want to move using tween, but control are using rect_position instead of position so I tried to set the nodepath to "rect/position" or "position" which both of them are not working.
if I use the "rect:position" I got an error that said :

Condition !prop_valid is true, return false

Am I correct using rect_position as tween property to move a control? or is there another way? thank you for reading.

in Engine by (66 points)
edited by

1 Answer

+2 votes
Best answer

Isn't it just rect_position?

This works:

var tween = Tween.new()
add_child(tween)

tween.interpolate_property( \
    $Panel, "rect_position", \
    Vector2(100,100), Vector2(300,200), 1.0, \
    Tween.TRANS_QUAD, Tween.EASE_IN)

tween.start()

Hint: you can check this by moving your mouse over the name of the property in the inspector, it will appear as a tooltip.

by (27,962 points)
selected by

thank you, I didn't realize the tooltip :D

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 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 webmaster@godotengine.org with your username.