Forum rules - please read before posting.

Hotspot in Unity UI

Hi there,

I've searched through a few posts regarding Hotspots in Unity UI (example 1 example 2, but can't seem to find a good solution.

Here is the setup:

• A Unity UI canvas set in screen space.
• A Scroll Rect element with a mask and content
• Multiple AC Hotspots inside the scroll rect's content

The idea is to scroll to the right part of the menu, grab an inventory item and drop it on the right hotspot to trigger an action list.

I don't think UI buttons make sense because I want the action lists to start when you drop an item on the menu.

Any pointers?

Comments

  • Any mockups / sketches you can share to help illustrate the intent will help clarify the situation, but Hotspots aren't designed to exist inside UI elements.

    What you could try, however, is to use a dedicated Inventory item instead - one that's placed in its own Category, and displayed in an InventoryBox element that's limited to that Category.

    Dropping an item on that will then trigger it's "Combine" interaction ActionList.

  • Thanks, Chris – I hadn't thought about using a hidden inventory category!

    My current workaround is:

    • Inventory box type container - 1 slot only.
    • Each inventory item has a property (integer between 1-10)
    • Using the Stat calculator script to change a variable when an item is dropped in the container.
    • Script to always check when the variable is changed and launch an action list.

    I need about 100 containers, so it's a lot of manual work to essentially replicate exactly what a Hotspot does (check which item is dropped somewhere and launch the appropriate action list).

    But using your idea is much more elegant, thanks!

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.