How could I ease the size and position of an object once after a condition is met?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Swizik

I simply want a button im clicking to snap to a position, and then slowly ease back into its normal position, giving more feedback from the click, but I can’t seem to figure it out no matter where I search, or what I try, I’ve looked through the ease and lerp functions which seem like what I have to use, but it’s still all so confusing to me, if anyone has some simple advice on how to ease like this, please let me know!

:bust_in_silhouette: Reply From: jgodfrey

You’ll want to drive this motion via either a Tween or an AnimationPlayer. Really, a Tween is probably your best bet. So, you can tween one or more properties over a specific amount of time, and include specific easing functions as needed.

I’d suggest that you check out the Tween docs as well as maybe watching a few relevant YouTube tutorials. Really though, this should be pretty easy.

completely my bad, I had the impression that the AnimationPlayer could only be used to animate a sprites images, since I animate a lot I see the word “Animation” as a series of images, not any value you want to “animate”, thank you.

Swizik | 2023-03-07 04:01