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

What is the proper way to use UDim2.new?

Asked by
Xianon 105
10 years ago
local Frame = script.Parent
local Label1 = script.Parent.Label1
local Label2 = script.Parent.Label2

game.Players.PlayerAdded:connect(function(Player)
    for i=1, 800 do
        Label1.AbsolutePosition = UDim2.new(Label1.AbsolutePosition.X + 0,1,Label1.AbsolutePosition.Y + 0,0) -- This is not the proper way because the script breaks here--
        wait(1)

    end

end)

1 answer

Log in to vote
0
Answered by
DataStore 530 Moderation Voter
10 years ago

The AbsolutePosition property is read only, which means that it can't be set. If you wish to change Label1's position then modify its Position property instead.

You could also use the TweenPosition method if you're looking to smoothly tween a GUI object to a particular position.

Ad

Answer this question