What is 'UDim2' and how do I use it?

Hi! I need a hand, I have read the documentation and seen some posts in the forum but it has not been very helpful, someone could explain to me what it is used for, how do i use it and if you guys could show me some example of code commented, please, I would appreciate it very much. :frowning:

All this is to improve my learning process :smiley:

Thanks you

2 Likes

UDim2 is basically a Position/Size value for GUIObjects. Letโ€™s say you want this GUIObject to be the whole screen, and itโ€™s 0,100,0,100 (or something else) size. Do this:

script.Parent.Size = UDim2.new(1,0,1,0)

Hope this helps! You can also use TweenService for this, which I highly recommend instead of just instantly scaling it.

6 Likes

Thanks a lot for your clarification! is very helpful, and what about โ€˜UDimโ€™, is it exactly the same? :open_mouth:

2 Likes

Iโ€™m not sure, but with a quick google search I got this:
image

3 Likes

Thanks you a lot brother! :smiley:

3 Likes

I was thinking of asking this question today but someone beat me to it

3 Likes