Hey I was trying to move a GUI using UDim2.
I put this command in my code to test how UDim2 works:
print(UDim2.new(UDim.new(1,0), UDim.new(0,0)))
It outputs
{0, 0}, {0, 0}
Is this supposed to happen? The Roblox Wiki says it should work.
Hey I was trying to move a GUI using UDim2.
I put this command in my code to test how UDim2 works:
print(UDim2.new(UDim.new(1,0), UDim.new(0,0)))
It outputs
{0, 0}, {0, 0}
Is this supposed to happen? The Roblox Wiki says it should work.
And the Roblox Wiki is correct, it does work.
You can construct a UDim2 3 different ways.
UDim2.new() : Creates a new UDim2, with all values set to 0.
UDim2.new(xScale, xOffset, yScale, yOffset) : Creates a new UDim2 with the given values.
UDim2.new([UDim] xDim, [UDim] yDim) : Creates a new UDim2 from the given UDim values.
The second constructor listed is the most commonly used method, but the third listed will work. I'm not sure how you got your results from attempting to print out the UDim2.
This discussion is preserved as it was. New answers, comments, and votes are closed.
6 comments
Can you stop downvoting everything i post? Gees..
your answer contained 30% of the information, its not a good answer
your answer contained 30% of the information, its not a good answer
Err...: http://image.prntscr.com/image/06980f6092044caebcaccf8dba776fa8.png
Perhaps it's because I am using a version of Roblox from 2 years ago.
Perhaps.