Tweensize Issues

Hello developers,

I’m working on the loading screen for my new game, and it seems that tweensize refuses to work.

the idea of it is when a button is clicked the screen gets covered in a black frame to transition from the loading to the main game.

Unfortunately, it doesn’t seem to do anything. I’ve set up a callback and it returns perfectly fine without any errors. literally nothing seems to happen except for the callback.

This is the script inside the button that when working intended will allow it to be clicked and causes it to tween a frame to cover the screen.

function sel()
	script.Parent:TweenPosition(
		UDim2.new(0, 0,0.001, 0), 
		Enum.EasingDirection.InOut,
		Enum.EasingStyle.Quad,
		0.5,
		true
	)
end

function unsel()
	script.Parent:TweenPosition(
		UDim2.new(0, 0,-0.095, 0),
		Enum.EasingDirection.InOut,
		Enum.EasingStyle.Quad,
		0.5,
		true
	)
end

function black()
	game.StarterGui.StartGui["1"]:TweenSize(
		UDim2.new(1, 0, 1.112, 0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Quad,
		0.5,
		true,
		print("Tweened real")
	)
	
	
	
end

script.Parent.MouseEnter:Connect(function()
	
	
	script.Parent.MouseLeave:Connect(function()

		unsel()

	end)
	
	sel()
	

	
end)

script.Parent.MouseButton1Click:Connect(function()
	
	black()
	wait(1)
	
end)

1 Like

I’m pretty sure the EasingStyle and EasingDirection arguments for TweenSize only
accepts a string for some reason, for example:

	script.Parent:TweenPosition(
		UDim2.new(0, 0,-0.095, 0),
		"InOut",
		"Quad",
		0.5,
		true
	)

Please let me know if I did anything wrong :slight_smile:

It still returns the callback, but still no results. pretty much exactly the same.

There are a couple of Issues at first glance,
One of them I see is a Big Issue, while the other is merely an inconvenience.

The Main Issue I noticed is you are using StarterGui instead of PlayerGui.
When the Player Joins the game, StarterGui gets sent to PlayerGui for it to be visible on the Client, What you see in Studio and on the Server is a Preview of the Gui that is inside StarterGui

Please note that StarterGui is NOT what the Player sees, PlayerGui is what the Player see’s

Another thing is you aren’t showing use the Entire code.

Oh yeah…

I guess i got to used to referencing startergui in local scripts I completely forgot I needed to do that.

Anyhow thanks for the help, Have a great day!

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