AC version: 1.86.1
Unity version: 6000.4
Hi everyone,
I'm working on a 2D project and I recently added the "UI template: Screen-space Hotspot detection".
My Goal:
I would like to use this specific screen-space detection method only when the game is set to Movement Method: Direct and Input Method: Keyboard or Controller. For other control schemes, I want to disable it and use the standard AC hotspot detection.
What I've tried:
I've written a custom script that handles the switch between these control schemes. Along with changing the Movement and Input methods, the script also successfully toggles the Hotspot detection method between Custom (for the template) and Mouse Over (for standard gameplay).
The Issue:
The problem is that even when these settings are changed to standard (whether I do it at runtime via script, or manually in the Settings Manager before entering Play mode), the game still forces the behavior of the "Screen-space Hotspot detection" template. I can't figure out how to properly deactivate the template's logic so the standard detection can take over.
Is there a specific script or component from the template that I need to disable/enable, or a proper way to revert to standard detection?
Thanks in advance for any help!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @StekJohn.
The custom scripts involved with the template are attached to the Screen-space Hotspot detector prefab, a copy of which will have been added to your game's ScreenSpaceHotspotDetection subfolder, besides the Managers directory.
This prefab gets spawned at runtime via the Scene: Begin game event in the Events Editor, and will affect gameplay for as long as it is present.
It's a bit brute-force, but you could try removing this prefab from the scene as part of your custom script, with:
I wasn't sure how it worked; I thought it was enough to change the hotspot detection type.
Thank you so much!