How to determine from which side we are scaling frame (left or right) on X axis

So today I got an idea to scale my frame from at default size of X as size 0 on the left side to the right as size 1 to get a fullscreen of the frame for several seconds and then I’d like to scale frame from left to right again so my size of X would be 0 on right side of the screen and not on the left side at the end. My problem is that I don’t know how to determine the left and right side scale in a local script because we are always scaling frame from 0 to 1 and in reverse.

1 Like

If I’m understanding this right, you want a frame to come in from the left side and leave on the right side? In that case, you’ll want to change the position and anchor point while the frame is covering the screen.

--(tween size to cover the whole screen or whatever)
frame.AnchorPoint=Vector2.new(1,0) --set anchor point to the top right of the frame
frame.Position=UDim2.new(1,0,0,0)
--(tween size back to 0)

You can read up on the anchor point here: GuiObject | Documentation - Roblox Creator Hub

1 Like

Thank you that’s what I needed, it sounds logical to me without reading anything more than your explanation, enjoy 100 solutions.