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

How do I use UDim2?

Asked by 10 years ago

I'm making a game and I'm trying to make the bar at the top of the screen say different sentences (This I know how to do), but I want to make it so that it doesn't just change, it should fly smoothly off the bar then another one should fly on. This is my current script:

StarterGui -> ScreenGui -> Frame -> TextBox -> Script

while true do
local GUI = script.Parent
GUI.Text = "Welcome to my game!"
wait(10)
-- Does more of these then it restarts
end

But how do you do it with UDim2? Can someone explain how to use it?

2 answers

Log in to vote
0
Answered by 10 years ago

UDim2.new(scaleX, offsetX, scaleY, offsetY)

I think that the scale values from UDim2 are values that will resize the GUI according to your screen size.

The position, you can just make the scales 0, and increase the offset by 10 each time the script runs.

0
Thanks. EmeraldSlash 0 — 10y
Ad
Log in to vote
-1
Answered by
Thetacah 712 Moderation Voter
10 years ago

You might want to take a look at this Wiki Page on TweenPosition.

http://wiki.roblox.com/index.php?title=TweenPosition_(Method)

genarally though, this is how you use UDim2:

Gui.Position =UDim2.new(0,0,0,0)

Answer this question