Formula for getting the gui to always go below the screen

I am currently trying to make a tweening module that will tween a gui’s position to always be below
a player’s screen on the Y axis based on its size, but I can’t seem to find the math that will do so. I’ve tried basicly everything, so much help would be appreciated. My anchor point is 0.5

1 Like

if the anchor point Y is 0.5, you need to move it down the full height of the screen plus half the height of the gui itself.

This is correct, but for me it only worked after using this formula and subtracting 0.05.

Editted Formula for anybody in the future: ((ui.Position.Y + ui.Size.Y) + (ui.Size.Y/2)) - 0.05

Formula for centering ui: ((ui.Position.Y - ui.Size.Y) - (ui.Size.Y/2)) + 0.05

I haven’t tested this in the client so it might just be the right one but from a studio stand point subtracting 0.05 seems to put it just right below the screen.

Thanks for the help!

That might be the case depending on whether IgnoreGuiInset is on for that gui.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.