Forum rules - please read before posting.

Unity UI Inventory Anchor to Bottom

Hi,
I followed this tutorial: https://adventurecreator.org/tutorials/creating-inventory-bar-unity-ui ...and it mostly worked.
I'm using basically the same setup as the tutorial but I want my Inventory bar to be aligned to the bottom of the screen.
I created my panel and set up Anchor presets in the Rect transform to bottom/stretch.
However when I check the instantiated UI in Game mode, the Anchor presets will not be the same, it always changes to top/stretch regardless of how it it set up in my UI prefab. I tried deleting the panel and recreating it with a new Constant ID but the problem persists. This forces me to use top/stretch because if I use bottom/stretch it will use the same value for PosY and the menu will be in a completely different place. This is a problem since it doesn't work properly when changing screen aspect ratio.
Is this a bug or did I miss something?

Comments

  • Welmcome to the community, @pablo285.

    In the Menu Manager, is your Menu's Position type set to Manual? If so, it shouldn't be moved by AC at runtime. Is the RectTransform that's moving the same one assigned as the Menu's RectTransform boundary property?

    The only thing that would otherwise influence it's position would be the presence of an Auto Correct UI Dimentions component. This is an optional component that is used to help correct the UI's appearance in different aspect ratios, but if it's attached you'll need to configure the intended anchor values in its Inspector.

  • Auto Correct UI Dimentions was indeed the culprit. I found out that I don't really need it and after removal everything works as expected. :)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.