Good practice for UI Animation

Hello :wave:

I am scripting some animation for my UI, and at each click I create a new Tween and play it.

Is it a bad practice ? Should I set them it in a variables and reuse it ?

2 Likes

yes, creating tween takes some processing, but if you using UI then just do frame:TweenPosition(UDIM2)

I’m using Tween because I do a popup animation and I set Visible to false/true in the tween.

Also TweenPosition is deprecated

1 Like

oh sorry didnt know that it was outdated

anyway by setting visible you mean transparency? I dont think you can tween boolean values

1 Like

No it’s Visible property of a frame.

So the best practice is to save my tweens in variables and just reuse it right ?

1 Like

yeah that is the way to go since its a fixed tween (its target values isnt change)

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.