Forum rules - please read before posting.

Creating Unity UI - based Interaction Menu.

I tried this tutorial http://www.adventurecreator.org/tutorials/creating-inventory-bar-unity-ui. It's very helpful, but I have some questions that are probably specific to the Interaction Menu.

1. Should the Unity UI menu have the same number of elements as the AC Interaction Menu?

2. Besides the obvious (Linked Button), do I need to make any changes to the original AC Interaction Menu? For example, should I change the Interaction elements to Button elements?

Thanks!

Comments

  • 1. No.  AC will control the UI elements that you tell it to - but you can have others in the UI that aren't controlled by AC if you want.

    2. If you've got your Interaction menu working when it's Source is set to Adventure Creator, then you don't need to change any elements when set to Unity Ui Prefab - all you need to do is link the correct UI objects.  AC Interaction elements get linked to Unity UI Buttons - but you don't need to change the elements type in AC's Menu Manager - just create a UI button and drag it over.
  • Thanks. That was very helpful!

    I got the Unity UI menu more or less functional. Now I'm trying to make it more user-friendly. Let's say I have 3 types of interactions in the menu. In most cases only one of them (Look At or Talk To) will appear for a given hotspot. Is it possible to always center the active interaction right under the cursor?

    Also, what is the meaning of the Cursor: selection in the Interaction element of the AC Interaction Menu? The cursor doesn't seem to actually appear on the screen, but if I select a wrong cursor, the menu doesn't work as expected.
  • Once you've set a Position type in the Menu's properties box, AC will use the RectTransform boundary you've defined as the box to centre it to.  For example, if you've set the position to On Hotspot, then the UI will be positioned such that your RectTransform object is centered on the Hotspot.

    Therefore, you will have to set up your UI canvas so that the RectTransform adjusts its size automatically according to the icons showing within it.  This could be done by using UI components like a Grid Layout Group (I believe), or by using custom scripts for greater control.  The idea behind AC Menus vs Unity UI is that AC Menus are easier/quicker to set up, but Unity UI provides greater flexibility and customisation.

    The Cursor property of an Interaction element determines what cursor icon the UI Button is mapped to.  Note that this is not a display setting - you will have to style your UI button with the correct graphic manually.

    So long as the menu's Appear type is set to On Interaction, you should find that undefined Interaction icons are not shown in the menu when a Hotspot is selected.
  • Thank you for the detailed explanation. The Grid Layout Group worked prefectly.
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.