Strange Hotbar UI Filling Behavior on Mobile

For my game, I created a custom hotbar to display the player’s tools. It centres the tools to the along the middle of the “hotBar” frame.

My personal cell phone is a Samsung Galaxy S20 FE (2400px, 1080px), so to test how the menu would appear on mobile, I inserted those dimensions into studio & tested the UI, it rendered normally as it should:

But when I load it on my phone on the Roblox app, the contents of the hotBar appear off-center:

I’ve already tried setting “IgnoreGuiInset” to True in the properties of the Parent ScreenGui yet the problem persisted.

That being said, what is the solution to fix this bug? I believe it may be unique to phones as when I played it on my desktop PC using the non-Windows app I didn’t face this issue. Same for on my Lenovo Yoga in tablet mode, despite loading in with touch controls, I didn’t face the same problem either. That being said, what about physical cell phones makes the UI center itself bizarrely & what can I do to resolve this issue?

It’s not exactly the computer or phone itself. What’s inside the GUI? It could be size offset or even position offset

Basically on the dropdown thing for position or size, it’ll look like
X:
X Offset:
Y:
Y: Offset

But it could also be some things added to the UI itself. Like a size constraint or anything

Could you please let us see the properties of the hotbar to see how you positioned it

Hey!

I have a couple things for you to try.

  1. It could maybe be the anchor point. Try changing the anchor point to 0.5, 1 on your main frame and reposition it. Unless you’ve already done stuff with the anchor point, this might fix it.

  2. It could also be that you are using offset instead of scale on your gui elements.

Hope this helps!

Not sure if you are already doing this, but you should use a UIListLayout for this if you aren’t:
https://create.roblox.com/docs/reference/engine/classes/UIListLayout

If you are already doing that and it doesn’t work, also try to set the ScreenInsets property of your ScreenGui to None. (Not sure if this will work, or cause other problems, so this is just a guess)

If none of this works, and all the other ideas that people had doesn’t work, it would help if we had some more details, like the properties and stuff which is what @hellie_jellie was saying.

These are the properties of the frame within the custom inventory:

AnchorPoint = {0.5, 1}
Position {0.5, 0.5}

These are the properties of the UIGridLayout:

As another update, I made a temporary change to show the absolute position of the items in the number so I can “print” it on my phone. This is what I got:

In studio using Galaxy S20 FE dimensions:

On Roblox App on my physical Galaxy S20 FE:

I’m not sure why the Y values of the UI are appearing differently on my physical phone, but I hope this provides extra context

I replaced the UIGridLayout with a UIListLayout, using the same statistics & it worked, I believe it may have had something to do with the way I setup the sizing of the Frame that was being copied. The Frames that were being used as a template to be copied & hold items were of Size = {0, 55, 0, 55}, relying on the UIGridLayout to resize instead. The bug has been patched though & elements are now being centered properly as they are supposed to.