Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ludosar | |
Old Version | Published before Godot 3 was released. |
Hi everybody,
I’m trying to animate the region_rect property of a sprite with a tween node, and so far, it doesn’t work.
I was able to animate other properties, but not this one, maybe because it uses a Rect2 var?
this is what I use:
var sprite = get_node(“Sprite”)
var current_coordinates = sprite.get_region_rect()
var target_coordinates = current_coordinates
target_coordinates.pos.x += 280
tween.interpolate_property(sprite, “region_rect”, current_coordinates, target_coordinates, 1.5, Tween.TRANS_EXPO, Tween.EASE_OUT, 0)