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

Why Isn't This Script For Making a GUI Frame Gradually Grow Bigger Working?

Asked by
8391ice 91
7 years ago

I am trying to make a game in which players join a side upon entering. They will do so by clicking one of two buttons on a GUI. In order to make the game more aesthetically pleasing, I want to make the GUI gradually get bigger rather than just appear instantly. However, this script I made should work, but when I test it out, nothing happens! Why is this?

script.Parent.Parent.Changed:connect(function() --When this ScreenGui's Enabled property is set to true, this script will fire.
    if script.Parent.Parent.Enabled == true then
        local frame = script.Parent.SideChoose --The frame that encompasses the two sides that the player can choose.
        frame.Size = UDim2.new(0.6, 0, 0, 0) --Setting the frame's Y's scale size at 0.
        for i = 0, .6, .006 do
            wait(.01)
            frame.Size = UDim2.new(0.6, 0, i, 0) --By the time this is over, the Y scale value should be at .6. But when I test the game and set the Enabled property to true, nothing happens! Why is this?
        end
    end
end)

Any help is much appreciated!

1
Use frame:TweenSize(UDim2.new(0.6,0,0.6,0),"InOut","Quad",TIME_DURATION,true) RubenKan 3615 — 7y

Answer this question