Help! how can I center objects in a GUI

Hello, I’ve always wondered, how can I center an object, but when a person is playing on a cell phone, is centered on the screen, but I can not, I see a bigger side and a smaller one, please help me as I can solve this!

If you need more information, just answer me!

10 Likes

Set the anchor point to (0.5, 0.5), and the Position to {0.5, 0, 0.5, 0}.

32 Likes

Ok! i will try it

2 Likes

Now the right side is bigger and the left side is smaller

2 Likes

You should check this out for more information about AnchorPoint.

You need to re-position your GuiOject to 0.5 on X.Scale

2 Likes

There is no easier way to do?

2 Likes

That is the easiest way to do it. What’s your Position property equal to?

3 Likes

Change that value to 0.5 to make it on the centre on the X axis.
Using 0.5 under scale makes your item centred in that axis. Because you put your AnchorPoint (0.5,0.5)

7 Likes

YES THANK U!!! really THANK U

2 Likes

There’s also a plugin that I have been using for a while now, it is very handy it helped me a lot, and does the things uJordy explained whilst being easy to use. Link to plugin

8 Likes

Ok! thank u

3 Likes

Hey, I have a better solution for you. I would recommend installing the Plugin AutoScale, You may also purchase the paid version for additional information.

Takes 2 clicks to apply.


You just need to click Scale in both, position and scale:

image

2 Likes