How do I change the size of the buttons and keep their position

Hello! When I change the size of Uis by using script, they look like their position is not the same, like when a button is in center. But when I change the size, that button is like moving to the bottom right direction. How do I fix that?

2 Likes

You have to change the anchor point to 0.5, 0.5 and then add 0.5 to x and y scale position of the frame or button

2 Likes