Forum rules - please read before posting.

Hotspot cycling stuck

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?

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:

    Debug.Log ("Cycle " + hotspots.Count + " Hotspots, Selected: " + selected + ", Forward? " + goRight);
    

    Ignore those that show while the input works, but what (if anything) shows when it doesn't?

  • edited September 2022

    Thank you for the prompt response!

    AC 1.74.5 / Unity 2020.3.37f1

    Does the problem only occur with this single Hotspot?

    Yes, only one hotspot in the scene behaves like that.

    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?

    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.

    Check that the state shows as "Normal" during this time.

    Yes, it's Normal after selection is set to problematic hotspot.

    Ignore those that show while the input works, but what (if anything) shows when >it doesn't?

    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.

  • Yes, only one hotspot in the scene behaves like that.

    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.

    Each time pressing CycleHotspotsLeft results changing Selected in the log output

    Is that to say the two log messages repeat in a loop, i.e. 0/1/0/1?

    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.

    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.

    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.

    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.

    Is that to say the two log messages repeat in a loop, i.e. 0/1/0/1?

    Absolutely correct.

    Try moving the Hotspot so that it becomes the first-selected.

    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.

    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.

    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!

  • edited September 2022

    2 hotspots both intersected

    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?

    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

    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.

  • edited September 2022

    Ok, we have found the reason. Not sure whether it's a bug or a result of incorrect setup on our side.

    1. Despite we set input method to Keyboard or Controller and hide cursor on the screen by Hide cursor when locked in screen's center it's virtually is still there in the screen center.
    2. In the scene the problematic hotspot is set exactly in the screen center where this invisible cursor still exists and it's exactly over the hotspot
    3. It causes KickStarter.playerMenus.IsMouseOverInteractionMenu() in PlayerInteractions on line 199 to return true, thus blocking ChooseHotspotThenInteractionClick() from running and breaking all navigation process.

    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!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.