So I am trying to make the mainFrame size expand after the GUI sets its position at UDim2.new(0.3,0,0.4,0).

local mainFrame = script.Parent.MainFrame
local secondaryFrame = script.Parent.FrameTwo
local textLabel = script.Parent.TextLabel
local easingDirection = Enum.EasingDirection.Out
local easingStyle = Enum.EasingStyle.Bounce

mainFrame.Position = UDim2.new(-1,0,-1,0)
secondaryFrame.Position = UDim2.new(-1,0,-1,0)
textLabel.Position = UDim2.new(-1,0,-1,0)

wait(0.1)

function newMainFrame()
	mainFrame:TweenPosition(
		UDim2.new(0.3,0,0.4,0),
		easingDirection,
		easingStyle,
		2
	)
	
	wait(5)
	mainFrame:TweenSize(
		UDim2.new(0.3,0,0.2,0),
		easingDirection,
		easingStyle,
		2
	)
end

newMainFrame()

Thanks for the Help!

3 comments

0

You should use TweenService. It has a yield function so it can do what you're trying to do. Or, as an alternate option you can use wait().

0

the wait does not work

0

I am using tween