I have a custom uGUI HUD that I've made. Some menus pop up over the entire screen. When I'm within range of an interaction, however, the "Click-To-Interact" button is rendered over my menu. I fixed this problem to an extent as I now have my menu rendering over the button, but if a user clicks in that spot where the button is (behind the menu), it still clicks the button and starts the interaction event. That's unfortunately just the nature of how Unity's GUI works/doesn't work.
So I'm pretty sure I need access to the interaction controller button to turn it off when I'm in a menu, but I am unable to find anything. Any ideas on how I might go about this?
I'm not using ORK menus for my HUD. I'm using Unity GUI. I suppose if I had the ability to manually "pretend" that I have an ORK menu up, that would work. Something like:
What IS controlled by ORK: The button that pops up when in range of an interaction AKA Interaction Button
What IS NOT controlled by ORK: Pause menu, Map Menu, Points Box AKA HUD
Order of Events 1. Walk into range of an interaction. 2. The Interaction Button pops up. 3. Open one of the menus in the HUD. 4. Click in the area of where the Interaction Button popped up. (You can't see it now that the HUD covered it.) 5. Leave the menu to discover that you've started the interaction.
Dunno if it could work, but maybe you could set Interaction Button as screen fader, in GUI Layers: that should be the order they are drawn on the screen... If not you must wait GiL for a "code command", or try to find some references yourself... Sorry.
If you don't need the interaction HUD, you can just turn it of by enabling No Display in the HUD's settings. Otherwise you could block interactions by either blocking the controls or by setting the system to be in a blocking event (i.e. only allows one event). Block when opening your custom menus and unblock when leaving them.
Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found. If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I need the interaction HUD to start events, but I don't want those events starting while I'm in my custom menus. As usual, your suggestion fixes my issue perfectly. I even found ORK.Control.InEvent to toggle my HUD so it's not showing when I'm in an event!
My old entry for Indie Game Making Contest 2015
ORK.Game.MenuActive = true;
Both Menu either interaction HUD is custom?
My old entry for Indie Game Making Contest 2015
What IS NOT controlled by ORK: Pause menu, Map Menu, Points Box AKA HUD
Order of Events
1. Walk into range of an interaction.
2. The Interaction Button pops up.
3. Open one of the menus in the HUD.
4. Click in the area of where the Interaction Button popped up. (You can't see it now that the HUD covered it.)
5. Leave the menu to discover that you've started the interaction.
My old entry for Indie Game Making Contest 2015
Otherwise you could block interactions by either blocking the controls or by setting the system to be in a blocking event (i.e. only allows one event). Block when opening your custom menus and unblock when leaving them.
Setting an event block:
ORK.Control.SetEventBlock(1);
Release event block:
ORK.Control.SetEventBlock(-1);
Blocking control:
ORK.Control.SetBlockPlayer(1);
ORK.Control.SetBlockCamera(1);
And -1 to release again :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Thanks!