Forum rules - please read before posting.

Inventory Items Shown Behind Mask

Hello everybody,
I'm not sure if this is a bug, an intended behaviour, or what... But I wonder if there's a way to avoid the following:

  • From the Demo2D Inventory Menu, select "Using UI prefab" and Appear Type: During Gameplay.
  • On the InventoryUI prefab create an UI mask which covers the first four slots and put the Grid of slots under it.
  • Create 8 random inventory items.
  • Play the game and notice that the items label is shown even if the items are hidden by the mask.

i.e. the first 4 items are visible and clickable, the second 4 items are invisible and not clickable, but the label is shown when the cursor is hovering them... and also the cursor changes if there's a specific cursor for interactions and "Change when over inventory items too?" is checked.

Here a screenshot: https://pasteboard.co/jda4reZxOkgM.png

I'm doing my own inventory scroll system, which relies on a mask. I've made everything works great, except this nasty "bug". Is there a way to avoid this behaviour? Maybe changing some settings? Or adjusting a script? Or maybe creating a new script which disable the item-acting-like-hotspot if outside the mask?

Thanks for the help.

Comments

  • AFAIK, the Mask component won't prevent a UI Button's interactability - it's purely visual.

    To prevent a Button from being clickable, attach a script that controls its "Interactable" property.

    As AC updates this value itself when menus are turned on and cutscenes are entered, you'll probably want to update this value every frame in order to override it.

  • Well, I've tried creating an invisible image on top of the outside-mask area, that targets the raycast, and if I press right (use) or left (examine) mouse buttons on those items, I cannot trigger their action, so the mask is somehow working this way, like it prevents interactions (clicks), but it cannot prevent the showing of a label and change of the cursor.
    And I've also tried to toggle "Interactable" bool on the buttons outside of the mask, the label is not shown this way, but the cursor changes shape when on top of them nevertheless, as if the InventoryBox slot being there is enough to make the cursor changing shape.

  • Can you PM me your Managers and Inventory UI prefab? I'll need to examine this myself.

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.