Forum rules - please read before posting.

Opening inventory menu with Unity UI button.

edited September 2022 in Technical Q&A

Hi, I'd like to use custom Unity UI button to open inventory menu. So far I've tried:

1) Changed the source of "Pause" to Unity UI prefab and linked the Canvas prefab in the Menu setting.

2) Made a button called inventory, and this button has On Click () Runtime Only Inventory(Action List Asset) attached to it.

But I am not sure how to open the inventory with action list. Both Inventory and Menu action type doesn't have an option to open inventory.

Please help, thank you. :)

Comments

  • If you assign the ActionList directly into the Button's OnClick event, make sure you're triggering its Interact function.

    The intended method to having a Button run an ActionList, however, is to create a Button element in your Menu's properties and link it to the Button object in the prefab's Hierarchy. You can then assign the ActionList inside the Menu Manager - a tutorial on this process can be found here.

    As for Actions, the Menu: Change state Action can be used to turn on a Menu - though exactly how will depend on that Menu's Appear type property.

    If set to Manual, you can use the Action's Turn On Menu method to turn the Menu on directly. Otherwise, if its bound by some condition e.g. While Game Paused, you can lock the Menu by default by checking Start game locked off?, and then show it when intended by unlocking it with the Action's Unlock Menu method.

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.