Help with Tweening a UI

In my game, I want to make a UI tween from above the screen to the middle of the screen.
I know this likely involves UDim2, but how would I go at it?

GuiObject:TweenPosition (roblox.com)

This should help you out!

what is the position of the ui at the moment?

local willPlay = guiObject:TweenPosition(
	GOAL_POSITION,           -- Final position the tween should reach
	Enum.EasingDirection.In, -- Direction of the easing
	Enum.EasingStyle.Sine,   -- Kind of easing to apply
	2,                       -- Duration of the tween in seconds
	true,                    -- Whether in-progress tweens are interrupted
	callback                 -- Function to be callled when on completion/cancelation
)```

taken straight from the link frriend sent

Thanks, I saw similar devforum resources but not that one

2 Likes

Also take a look at the easing styles here

insert a local script into the gui
script.Parent:TweenPosition(UDim2.new(0,0,0), “Out” , “Quad”, 0.5) --put the position you want to tween it to in 0,0,0

1 Like