Forum rules - please read before posting.

UI breaks hotspot detection

Hey there,

I've been scratching my head over a problem with a menu, so maybe a fresh pair of eyes can help me out.

AC 1.51f
Unity 5.3.5

I made a menu using Unity UI, and hooked it up to AC in the usual way. It's a simple menu that shows the button mappings for certain gameplay mechanics. It should be shown during gameplay, and it has 6 images on it.




Problem is: whenever this menu is enabled it breaks the Hotspot Vicinity detection. Normally when I start the game the Hotspot UI shows up right away because the player is standing next to a hotspot (I'm using Direct Control - keyboard & controller). But now, the hotspot UI flickers for one second and then turns off. Walking to other hotspots shows the same problem: hotspot UI shows up one second (or sometimes not at all) then turns off again. Same right after I open and close a Pause Gameplay menu. There are no custom scripts on the UI, just a regular canvas with a grid layout containing 6 images.


  • Any problems if you temporarily switch this new Menu's Source to Adventure Creator?

    When the game is running try disabling the child objects or base components to see if they have an effect.  If you find that a particular object/component is causing it, that'll help us find a solution.
  • Alright, tried those things, here's what happened:

    - If I switch to AC as the source: no problems. Of course the menu looks different, but the elements unlock as they should during gameplay, and they never block the hotspot detection.

    - With the source switched back to Unity UI, I tried disabling the elements and components separately, but nothing caused the hotspot UI to show up correctly again. Any active child elements within the grid could not be switched off, probably because the menu manager is telling them they should be visible, so they stay visible.

    - If I disable the root inventory UI gameobject altogether (turning off the menu), then walk into the vicinity of another hotspot, the hotspot UI shows like normal. But only for a second, because the inventory UI reactivates itself, causing the hotspot UI to disappear again at that point.

    I tried checking other menus for their canvas and layer settings but I don't really see anything wildly different between them. I turned off any setting that I thought might block raycasts and all that, since the menu requires no input, but it still almost seems like it's covering up the screen or something, I don't know. As far as I can see this is the only menu out of all of them that behaves this way too.

    Well, at least I could switch to AC permanently for this menu if the cause remains a mystery.
  • Apologies - I should have remembered that linked UI elements have their "enabled" state set by AC.  To get around that (as part of the test), you could duplicate the Menu's entry in the Menu Manager and remove the elements, so that only the root Canvas is enabled/disabled through AC.

    Then unset the Canvas in the original Menu, so that the elements aren't affected by that one either.  You should then be able to properly test the child objects.
  • Oh yeah good idea. I removed all the menu elements in the manager and set it to show on an input key, but disabling any part of it, even the root canvas gameobject, doesn't bring the hotspot UI back. At least not until I press the chosen input key again. I could actually see the hotspot UI turning on and off completely in the hierarchy when I press the inventory UI key. It's like nothing else is allowed to be visible when the inventory UI is called on.

    So next I completely removed the Inventory menu from the manager and put the Unity UI in the scene directly, and that didn't conflict with anything, worked as intended. Then I hooked it up to AC again from scratch and the problem came back, so it's definitely something in the middle there.

    I can make it work with just the Unity UI, this menu doesn't need any input or anything, but it sure is strange.
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.