Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't anything happen when I try to tween my GUI?

Asked by 6 years ago

Here is my script:

Background = script.Parent.Parent


game.Players.PlayerAdded:Connect(function()
    wait(4)
    Background:TweenPosition(UDim2.new({0.346, 0},{0.233, 0}), "Out", "Bounce", "2")
end)

script.Parent.MouseButton1Click:Connect(function()
    Background:TweenPosition(UDim2.new({0.325, 0},{-0.582, 0}), "In", "Bounce", "2")
end)

I have no idea why this won't move from it's position off-screen, to where I want it. I've tried putting a wait at the top of the script so the GUIs would have some time to load. I've tried removing the bottom Tween, nothing. The top tween won't work, and I haven't tested the bottom.

0
Remove the PlayerAdded thing - just do the tween instantly. You're not using it correctly. TheDeadlyPanther 2460 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

I have no clue why the PlayerAdded is in your script but I'll leave it there regardless

Your problem is you put brackets around each two values in your Udim2 function

It should be more like this

Background = script.Parent.Parent


game.Players.PlayerAdded:Connect(function()
    wait(4)
    Background:TweenPosition(UDim2.new(0.346, 0, 0.233, 0), "Out", "Bounce", "2")
end)

script.Parent.MouseButton1Click:Connect(function()
    Background:TweenPosition(UDim2.new(0.325, 0, -0.582, 0), "In", "Bounce", "2")
end)
Ad

Answer this question