Hi,
We are now changing control scheme from point and click with a mouse to direct control using gamepad for a 2D adventure game. One of the phases is interaction with hotspots adjustments.
What is done:
1. Interface settings set to https://postimg.cc/dhDLKPwP
2. Hotspot settings set to https://postimg.cc/XZkMHqmV
3. CycleHotspotLeft assign to a button
4. Hotspot detector added to Player object
5. What is good - setup works. Interactions on hotspots are highlighted when player comes near, if several hotspots are available, we could cycle between them using button assigned to CycleHotspotLeft, Interaction button activates selected interaction
What is bad - on a certain Hotspot, the very same each time on the test scene, cycling becomes broken, pressing CycleHotspotLeft does not cycle between hotspots anymore, Interaction button does not activate interaction on a hotspot.
Please, advise on how to debug this further?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @silveruga. What are your AC and Unity versions?
Does the problem only occur with this single Hotspot? What happens if you approach it such that a different Hotspot is first selected, and you then press the CycleHotspotsLeft button, so that the problematic Hotspot becomes selected?
The first thing to check is the game's state, which you can view in the AC Status box. This can be enabled from the bottom of the Settings Manager, and will display in the corner of the Game window at runtime.
Check that the state shows as "Normal" during this time. If not, it'll list any ActionLists that are blocking gameplay.
If it is, we can try printing some logs in the Console to help debug things. When CycleHotspotsLeft is pressed, and you're in gameplay, the DetectHotspots script's CycleHotspots function will run. Look for it around line 334 and paste the following inside:
Ignore those that show while the input works, but what (if anything) shows when it doesn't?
Thank you for the prompt response!
AC 1.74.5 / Unity 2020.3.37f1
Yes, only one hotspot in the scene behaves like that.
Actually it's our current case - when player approach the area with this hotspot, different hotspot is selected by default. The problematic one is becoming selected after pressing CycleHotspotsLeft.
Yes, it's Normal after selection is set to problematic hotspot.
Cycle 2 Hotspots, Selected: 0, Forward? False
Cycle 2 Hotspots, Selected: 1, Forward? False
Each time pressing CycleHotspotsLeft results changing Selected in the log output. But that is weird because on screen the selection stays with only one of two available hotspots and interaction does not work.
Is there anything about this Hotspot that is noticeably different from others, whether it be its position, shape or settings? If possible, share screenshots showing the Scene-view layout of the Hotspots and the Hotspot Detector collider at the time the issue occurs.
Is that to say the two log messages repeat in a loop, i.e. 0/1/0/1?
Try moving the Hotspot so that it becomes the first-selected. You're welcome to also PM me the scene file along with your Manager assets + Player prefab - it may be the only way for me to recreate the issue, as it sounds like it's specific to your scene.
Hi, Chris.
At least to what we see - no material differences with other hotspots, apart from calling Constant ID script, which we tried to remove without any effect. I'll share the screenshot of the scene later, but what it shows is 2 hotspots both intersected with hotspot detector collider which perfectly aligns with debug output.
Absolutely correct.
Done, cycling stuck from the very moment of hotspot detection. Still in debug we see hotspots are changing in cycle, visually interaction indicated on the problematic one, as I described above.
Thank you, I'll try to share later tomorrow.
Meanwhile our idea is to debug further, probably somewhere in PlayerInteractions to check why interaction icon does not disappear on hotspot after deselection and why interaction itself does not work. If you could point out where to look for it that would help us a lot.
Thank you!
Are the Hotspots overlapping one another, and is interaction still prevented if the other one is moved away so that only the problematic Hotspot remains?
The Hotspot should be passed to PlayerInteraction via the GetSelected call in the CheckForHotspots function - but if there is a bug with AC, I will need to recreate the issue for myself in order to issue an official fix.
Thank you, we will try to debug further. Meanwhile I have PMed you all assets you requested.
Ok, we have found the reason. Not sure whether it's a bug or a result of incorrect setup on our side.
Chris, please let us know whether we should change setup anyhow OR this will bу fixed in AC probably by altering how mouseover detection works for Keyboard or Controller input method.
Try checking Ignore input? in the Interaction Menu's properties.
Yes, that solves the issue. Thank you for the prompt help!