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)