Forum rules - please read before posting.

Touch movement stops, Simultaneous Hotspot labels script and Proximity-based Interaction menus

I'm using the Simultaneous Hotspot labels script and Proximity-based Interaction menus to create Life Is Strange-style interactions.

But the problem is that the player stops moving as soon as the hotspot menu is activated.
In other words, the touch input is disabled when the hotspot menu is visible.
In other words, the direct movement method and direct movement: drag based is not working when the HotspotDetector on the player detects and activates the hotspot menu.

I'm using Unity version: 2020.3.2f1
And Adventure creator version: 1.75.6

Here are some screenshots of my inspector and settings.
Interface Settings: https://imgur.com/a/UzOt7kI
Hotspot Settings: https://imgur.com/a/FTCDp9m
Hotspot menu settings: https://imgur.com/a/uJEZNGB
Interaction menu settings: https://imgur.com/a/sz3lYwk
Movement settings: https://imgur.com/a/mpcVwuB
MultiHotspotLabel script on hotspot Gameobjects: https://imgur.com/a/fkyEoN8
InteractionOnNearest script added to player prefab: https://imgur.com/a/q0u18xg
Game view and Scene view Video: https://imgur.com/a/EI239mT

Player Switching: Do not allow
HotsoptDetctor is added to the player prefab as a child.
I'm making the game for touch screen devices.
It is currently set as Android in the build settings.
There are no console errors.
I'm an artist and know nothing about coding and I don't want to spend any time trying to understand code.

Thank you for your help.

Comments

  • edited September 2022

    I think I solved the problem by changing the Old Interaction menu: appear type to On Hotspot. I was misled as renaming the menu to Interaction_old did not tell AC to use the new interaction menu. But how do I choose which menu AC should be using for Interaction Menu?
    https://imgur.com/a/yNYHg5l

    And the other problem is the character doesn't turn their head toward the hotspot.
    Player settings: https://imgur.com/a/y0bTaTx
    Hotspot settings:https://imgur.com/a/Nz8Djf7

  • edited September 2022

    After implimenting the Life is strange interactive menu, the interaction buttons are not triggering the hotspot actionlist. And also I choose to show only those buttons which are linked to available interactions for the hotspot, but all the buttons showing. The actionlist runs fine if I click on the Run button.

    Video: https://imgur.com/a/izkusMt
    Interaction menu: https://imgur.com/a/kTLyrcw
    Hierarchy: https://imgur.com/a/HjOuUQk
    Use menu button: https://imgur.com/a/JnKIufM
    Hotspot: https://imgur.com/a/9ama70P
    Settings manager: https://imgur.com/a/2wGQosN

    I'm using Unity version: 2020.3.2f1
    And Adventure creator version: 1.75.6

    Player Switching: Do not allow
    HotsoptDetctor is added to the player prefab as a child.
    I'm making the game for touch screen devices.
    It is currently set as Android in the build settings.
    There are no console errors.

  • Welcome to the community, @RajSeelam.

    Your Interaction menu will need to have its Appear type property set to On Interaction in order for it to respond to the Hotspot it's being turned on for - i.e. only showing the relevant icons.

    Setting this back, do you still get the character control issue if you set the Input method to Mouse And Keyboard? This may be an issue with the "Touch Screen" mode combined with your other settings - I will attempt a recreation.

    the character doesn't turn their head toward the hotspot.

    Head-turning requires either the use of IK, or up/down/left/right looking animations to be supplied. This topic is covered as part of the 3D Primer tutorial here.

  • edited September 2022

    Thank you for the warm welcome Chris,

    Ok, I've switched the Interaction menu's** Appear type** to On Interaction and changed the Input method to Mouse and Keyboard and you were right, it works. So the problem is with the touch screen input method as you suggested.

    Using the mouse and keyboard movement method I could move freely and the hotspot menu was activated, but nothing happens when I click on any of the interaction buttons. Not even a blink or any press effect is visible.

    Am I doing something wrong with the In scene UI or was something else causing the problem? Here are screenshots of the UI Inspector:

    Interaction UI Canvas: https://imgur.com/a/Vo9xEU0
    Rect Transform Boundary: https://imgur.com/a/TMaOaWq
    Button: https://imgur.com/a/8FR9aDy

    Please let me know how we could fix the problem with touch screen input.
    And about the interaction buttons, I might be missing something basic I think. Please look into it.

    And the head-turning works. Sorry for not doing enough searching before panic-posting it here. I'll take care doing more research before posting it here in the future.

    Thanks

  • Please let me know how we could fix the problem with touch screen input.

    Open up AC's PlayerInput script and look for the following towards the bottom of its SetDragState function (around line 1996):

    else if ((KickStarter.settingsManager.movementMethod == MovementMethod.Drag || KickStarter.settingsManager.movementMethod == MovementMethod.StraightToCursor ||
        (KickStarter.settingsManager.movementMethod != MovementMethod.PointAndClick && KickStarter.settingsManager.inputMethod == InputMethod.TouchScreen))
        && KickStarter.settingsManager.movementMethod != MovementMethod.None && KickStarter.stateHandler.IsInGameplay ())
    {
        if (!KickStarter.playerMenus.IsMouseOverMenu () && !KickStarter.playerMenus.IsInteractionMenuOn ())
        {
            if (KickStarter.playerInteraction.IsMouseOverHotspot ())
            {}
            else
            {
                dragState = DragState.Player;
            }
        }
    }
    

    Replace it with the following:

    else if ((KickStarter.settingsManager.movementMethod == MovementMethod.Drag
        || KickStarter.settingsManager.movementMethod == MovementMethod.StraightToCursor
        || (KickStarter.settingsManager.movementMethod != MovementMethod.PointAndClick && KickStarter.settingsManager.inputMethod == InputMethod.TouchScreen))
        && KickStarter.settingsManager.movementMethod != MovementMethod.None && KickStarter.stateHandler.IsInGameplay () && !KickStarter.stateHandler.MovementIsOff)
    {
        if (!KickStarter.playerMenus.IsMouseOverMenu ())
        {
            if (KickStarter.playerInteraction.IsMouseOverHotspot ())
            {}
            else
            {
                dragState = DragState.Player;
            }
        }
    }
    

    And about the interaction buttons, I might be missing something basic I think. Please look into it.

    Check that the Button elements list a Constant ID value that matches that of the component on the UI GameObjects - this is how AC links the two together at runtime.

    Try also temporarily switching the Interaction menu's Source to Adventure Creator. You may have to tweak the visual sliders in the Menu Manager while previewing it in the Game window to get things in roughly the right position, but use this to see if the Menu still doesn't react properly, or if the issue is to do with Unity UI.

  • edited September 2022

    Thank you for the code. It solved the movement problem. Thanks a ton for the great support.

    I took note of the Constant ID values and double-checked them. They seem to match. I have tried both Unity UI Prefab and Unity UI In Scene It doesn't work.

    But then I tried the Adventure creator's UI and the buttons work as expected. The problem is caused by Unity UI I guess. At this point, I was confused about where to look and what screenshots to share.

    I have tried changing most of the settings related to Interaction. But no luck.

    I was also hoping that we show the hotspot menu with the Interaction buttons. Right now there is no intereption in the movement but only the Interaction buttons are visible but not the hotspot menu. The hotspot menu is visible only when the player stops moving. If we show the hotspot menu even when movement happens then players can know what interaction is present in that area.

    Please guide me forward on how to solve this.

  • edited September 2022

    I got the interactive buttons working. I was using a canvas inside a canvas to contain the buttons. I replaced the RectTransfor from Canvas to Panel and it fixed the problem.

    What I'm looking for now is a way to show the hotspot menu even when I hold down the touch or click. The hotspot menu disappears when we tap the screen and won't show until we release the tap. This makes it difficult for players to identify which hotspot they are on when moving.

    I noticed one thing. When I move the cursor outside the panel which contains the buttons, only then the Hotspot menu appears. This will make the hotspot menu unusable on a touch screen device as lifting the finger leaves the cursor on the spot.

    Here is a video: https://imgur.com/a/VkMgmjp

  • I was also hoping that we show the hotspot menu with the Interaction buttons

    Are you looking to always show the Hotspot name and the Interaction buttons at the same time? If so, try setting the Hotspot menu's Appear type to On Interaction.

    When I move the cursor outside the panel which contains the buttons, only then the Hotspot menu appears.

    At what point does this occur in the video? If the Interaction menu's display is controlled through the InteractionOnNearest script, then it should only turn off when the Player leaves the Hotspot's proximity - it shouldn't be set by the cursor's position.

  • edited September 2022

    Okay, I set the Appear type to On Interaction for the hotspot menu and the text doesn't update unless I move the cursor above the RectTransformBoundary of the InteractionUI.

    Here is a video:https://imgur.com/a/ZUCFYQd

    What's happening in the video is

    1. Cursor in the recorded video is always in the bottom right corner of the screen over the RectTransformBoundary of the Interaction Menu. This is to show the problem.
    2. Character walks to Book hotspot but the hotspot menu doesn't show. This happens most of the time with all the hotspots.
    3. And walks to Pizza and the hotspot menu shows correctly.
    4. Then walks to the TV and it updates the text to TV correctly.
    5. Walks back to the Pizza and the hotspot menu text is still showing TV, Incorrect.
    6. Walks to the book and the hotspot text is updated to book correctly.
    7. Walks to pizza and text is still Book. Incorrect.
    8. I slowly move the cursor up outside of the RectTransformBoundary of the Interaction menu and once I move out of the RectTransformBoundary the hotspot menu text gets updated to pizza. Which is the actual active hotspot. This could be showing the reason for Hotspot text not updating when the cursor is over RectTransformBoundary of the Interaction Menu.
    9. Character walks to the TV but the hotspot menu text is still showing Pizza. Incorrect.
    10. I move the cursor up outside of the RectTransformBoundary of the Interactive menu and once I move out of the RectTransformBoundary the hotspot menu text gets updated to TV.

    So the hotspot text doesn't update unless I move the cursor outside of the Interaction menu area.

    Hotspot menu settings:https://imgur.com/a/IT5CnGr
    Placement of RectTransformBoundary of Interaction Menu:https://imgur.com/a/pCICktA

  • Thanks for the details. It may be a case of changing/reducing the custom scripts involved - if you're only showing one Hotspot label at a time, in the same place, the simultaneous label script shouldn't be used.

    If you could PM me the project as a zip file, I'll be able to dig in properly to see exactly what's going on and what should be changed.

  • Hi Chris, I sent you the link to download the project in PM.

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.