After using AC for a couple of years with no problems I am having problems the last 2 weeks with hotspots in my project and am at a loss to work out what is wrong.
Today, there are no errors in the console but hotspots that had been working fine are now not working.
If I change the Menu manager to the Demo manager then the Hotspots work again. If I compare my game's Menu manager with the Demo manager I can't seem to see any differences, so am now very confused what has happened so that the clicking on the hotspots doesn't produce any results if I use my Menu manager.
Prior to this problem last week I had a problem with some hotspots and discovered that for these problem hotspots the colliders were set to BoxCollider and not BoxCollider2D and had to remove the BoxCollider and replace with BoxCollider2D. I don't understand how these hotspots were set to BoxCollider as the project has always been a 2D project. It was frustrating to go through and change these but once changed the project was working again last week until I picked up the project again today.
I haven't had any error messages at any stage. I added comments to the fitst node in the action list for the hotspot use interactions and could see that these were not run as no comments were seen in the console.
I made a copy of the project and updated Unity to see if that might help but still had the same problem.
I would be grateful for any pointers as to what is going on and how I can get my games managers to work for hotspots again.
AC v 1.77.4
Unity version 2022.3.5f1 and 2022.3.1f1 both have the same problem.
Apple silicon Unity versions.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Does anyone know where I can look further to work out why my hotspots have stopped working with my managers. As can be seen from the Menu options for Hotspot the settings for the Demo managers and my managers seem to be exactly the same.
I am assuming something is wrong/different somewhere but I don't know where else to look to find out more. I want to work out how to fix my managers or how to start with a new set of managers but transfer all my work already done (menu items/variables etc) into a new set of managers.
Welcome to the community, @CopperKettleGames.
When using AC's Scene Manager to auto-create new Hotspots, AC will look to your game's camera perspective to work out if it needs to add a 2D or 3D collider.
This behaviour will extend to other objects as well - such as Cameras and Markers.
Your game's camera perspective is set in the Settings Manager's "Camera settings" panel - is this set to 2D? If so, create a new Hotspot and check what collider type is being added to it.
I don't see any issue with your Hotspot menu - are you switching over only your Menu Manager when comparing, or other Managers as well?
If the Hotspot menu isn't showing, it'd typically be down to either the Hotspot not being detected, or the Menu being locked - though you'd get a Console message about the latter.
Can you share a shot of your full Settings Manager? This details both your game's perspective, as well as all the settings related to the way Hotspots are interacted with.
Let's also see the full Inspector for a typical Hotspot. Rest assured, while it may be a minor setting somewhere that's hard to spot, it shouldn't be a case of having to rebuild your Managers.
Thanks Chris. Here are screenshots of the Settings Manager and one of the Hotspots. I just changed the Menu manager to the Demo one to get the Hotspots working again.
Here is a screenshot of a newly created Hotspot using the AC Scene prefabs Hotspot2D section.
There's no apparent issue from your screenshots.
If just switching the Menu Manager is enough to show the Hotspots, it may be related to the other Menus you've created.
Where does your Hotspot menu stick in the stack relative to others? Generally, as it's dependent on others (e.g. Inventory), it should be at the very bottom. Try moving it to the bottom of the Menu Manager - does it then work?
If not, check for any Menu that may be blocking the mouse in the scene - even if it's invisble, a Menu that covers the screen will block mouse clicks over it.
Thank you for all your help Chris.
The Hotspot Menu wasn't at the bottom of the stack but when I moved it to the bottom it didn't make any difference, so as you suggested I looked at all the other Menus.
Comparing with an older project version, one of the Menu options was different in this non-working version. It is a menu that uses a Unity UI Prefab as source. When I compared the Panel on the non-working version to the old version I could see the problem. I have no idea why the panel settings were different as these haven't been touched in a long time but the non-working version had a panel stretched out across the whole screen whereas the old version was just set to a small area of the screen where the Menu button was.
I would never have thought of looking there as I haven't changed anything there in ages. Puzzled as to how it changed but very pleased it is now fixed - thank you again for your support.