Hello, I have an issue with the detection of hotspots in my 2D camera adventure. All the hotspots near the top of the screen are being detected incorrectly. Those that are closer to the center or bottom of the screen work fine. Here are some examples for you:
https://drive.google.com/file/d/1La6YmADFQuCgK0UQsxE7GoTBmSiemDYH/view?usp=sharing
https://drive.google.com/file/d/1F5kXUDMbAp0zFfRHHwDUHsCuYHAmk0IC/view?usp=sharing
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Are all the objects involved (including the Player and Hotspot detector) on the same position in the Z-axis?
What are your AC/Unity versions, and can you describe the exact behaviour in more detail? Is that to say such Hotspots are being detected when they shouldn't be?
Share also screenshots of your Player + Hotspot Detector (both their Inspectors, and how they appear in the Scene window), and your Settings Manager so that I can see the full context.
Hi,
All the hotspots and the player are at Z=0.
Unity 2020.3.42f1 with AC 1.81.6.
The mouse is within the hotspot area, but the label doesn't appear. It seems like the hotspot area is positioned lower than where it actually is. If you move the mouse down, it gets detected.
(hotspot settings)
https://drive.google.com/file/d/1_2h6lQ7G-3pdwPHdrlxMyb5X5OsCtUbm/view?usp=sharing
(player settings)
https://drive.google.com/file/d/1dDC9dAu8s7E2mxI0I6WvCLEw3FeyA41T/view?usp=sharing
(settings manager)
https://drive.google.com/file/d/1sakESquyXamTm-U06PzzB8CLRvF8q7G6/view?usp=sharing
(the scene)
https://drive.google.com/file/d/1ULNgeSOu07zvUJ51SFP720i3BbR4T-yr/view?usp=sharing
thanks in advance!
What's your Camera's Projection field set to?
If it's set to Perspective, see if setting it to Orthographic fixes the issue.
Otherwise, PM me your Managers + scene file, and I'll take a look.
The camera is orthographic. I tried increasing the orthographic size to zoom out the camera. This causes the hotspots to move away from the top edge of the screen, and then they work. It's very strange. I'll try to figure out how I can send you the scene easily.
I don't need the artwork - the scene file + Managers should be enough.
I'm sending you a compressed link with the scene and the managers:
https://drive.google.com/file/d/1DczKcYIBPFnIWb6cpmUuHtppB4rRMThV/view?usp=sharing
The Hotspots select fine on my end - though I had to switch the Hotspot menu back to use Adventure Creator as its Source.
Does clicking the Hotspots have no effect, or is it just the Hotspot menu failing to appear?
The Player prefab didn't load correctly on my end - try removing it from the scene/game. Does selection work then?
Check that there are no colliders in the scene that may be blocking the mouse raycasts over the Hotspots.
First of all, thank you very much:
Clicking on the hotspot located at the top of the scene has no effect, and the label doesn't appear. The player prefab is missing because I didn't include it in the compressed file, but in my project, it works correctly. The only colliders in the scene are the ones belonging to the hotspots themselves.
I've recorded a very short video where you can see the problem. Try watching the video: Can you see the issue with the hotspots at the top of the screen? They are only detectable at the bottom of the collider.
https://drive.google.com/file/d/11gnOlA2yd4EbiHFqWIPpD2uOtBc9DXma/view?usp=sharing
Do they become selectable if you raise the GameCamera's Y offset, such that the Hotspots then appear in the centre of the screen?
If so, it may be a Menu issue - with a Menu's RectTransform boundary blocking the mouse detection.
Though no visible appears visible, check your Hierarchy for any Menu UI prefabs that may be active. The "RectTransform boundary", set in the Menu, should describe the visible portion of a Menu - inside which clicks to the scene will be ignored.