Forum rules - please read before posting.

Touch screen and interactions

Hi,

I have a small problem in touch screen mode with interactions on mobile.

My problem is that if you touch a hotspot, the interaction icon appears but you have to press once again to perform the interaction while in mouse and keyboard mode you just have to click once for the interaction to be performed.

The second problem still in touch screen mode is that the interaction icon is draggable. If you tap the interaction icon once and hold it, you can move it anywhere on the stage, it's not locked. How can I solve these problems ?

Thank you for your answers.

Comments

  • My problem is that if you touch a hotspot, the interaction icon appears but you have to press once again to perform the interaction while in mouse and keyboard mode you just have to click once for the interaction to be performed.

    Look for the Settings Manager's Hotspot input mode - it's set to Touch Twice by default so that the user can avoid mis-taps on the wrong Hotspot.

    The second problem still in touch screen mode is that the interaction icon is draggable. If you tap the interaction icon once and hold it, you can move it anywhere on the stage, it's not locked.

    That sounds like the cursor showing. Disable Interaction icons in the Cursor Manager, and instead use the Settings Manager's "Hotspots" panel to set up Hotspots to show their own icons via their Highlight components.

  • Ok, I put touch down instead of touch twice.

    I disabled the icon interaction in Cursor manager

    but in Hotspot, what do I need to change to have the icon that is displayed just when I touch the hotspot?

  • edited October 4

    That's ok, I checked the "Enable when associated Hotspot is selected" box in the Highlight component and it works fine.

  • On the other hand, I noticed that with Detect Hotspot that sometimes when you approach a hotspot and the interaction ends as a play speech, the icon reappears which is normal with the Detect Hotspot but when you leave the hotspot area it feels like a little blink of the icon before it disappears.

    As if he disappeared, reappeared and finally disappeared. It does not disappear all at once. But it doesn't always do.

    It also does it without the interaction playing, if you go into the room towards a hotspot, the icon appears with Detect Hotspot and when you move away sometimes it makes this icon flash.

  • Does Highlight Hotspots based on cursor proximity? make any difference?

    I'm not clear on your meaning. Are you able to share a video of what happens?

  • Yes, here's a video:
    https://uploadnow.io/s/fcbd8e60-0ccc-4c2b-83b0-349c471aab94?o=t

    We can see that when the character crosses the hotspot that displays the icon with HotspotDetector, there is then a flashing of the icon when the character leaves the hotspot.

  • Your "Hotspot detection method" is set to "Mouse Over" - it's not using the Hotspot Detector by itself. Is the icon's display a result of an earlier custom script?

  • edited October 6

    I used the script you provided me in this post :

    https://adventurecreator.org/forum/discussion/16280/mouse-over-and-vicinity-with-method-point-and-click#latest

    When I asked for explanations on how the Hotspot Detection Method works with mouse over.

  • Can you share screenshots of your full Settings Manager?

  • Yes, here are the screenshots

  • Try this instead:

    using UnityEngine;
    using AC;
    
    public class ShowNearbyHotspots : MonoBehaviour
    {
    
        public DetectHotspots detectHotspots;
    
        void Update()
        {
            var nearbyHotspots = detectHotspots.GetAllDetectedHotspots();
            foreach (var hotspot in KickStarter.stateHandler.Hotspots)
            {
                if (hotspot == null || hotspot.highlight == null) continue;
                bool showIcon = hotspot.IsOn() && KickStarter.stateHandler.IsInGameplay() && IsNearby(hotspot);
                if (showIcon) hotspot.highlight.HighlightOn();
                else if (KickStarter.playerInteraction.GetActiveHotspot() != hotspot) hotspot.highlight.HighlightOff();
            }
    
            bool IsNearby(Hotspot hotspot)
            {
                foreach (var nearbyHotspot in nearbyHotspots)
                {
                    if (nearbyHotspot == hotspot) return true;
                }
                return false;
            }
        }
    
    }
    
  • Thank you, it's working really well now.
    What was the problem in the script ?

  • In fact, it works very well in the editor but when it's compiled, it sometimes still does it very very slightly.

  • And I just noticed a problem, it's that I can no longer use my button that displays the hotspots when you click on it. As soon as I put the previous script back, my button with FlashHotspots works fine again.

  • I'll need details about this button.

  • It's a simple menu named HotspotAction with which I use the flashhotspot function.

  • First, open up AC's Highlight script and add the following function:

    public bool IsFlashing() => highlightState == HighlightState.Flash;
    

    Then, replace the above script with:

    using UnityEngine;
    using AC;
    
    public class ShowNearbyHotspots : MonoBehaviour
    {
    
        public DetectHotspots detectHotspots;
    
        void Update()
        {
            var nearbyHotspots = detectHotspots.GetAllDetectedHotspots();
            foreach (var hotspot in KickStarter.stateHandler.Hotspots)
            {
                if (hotspot == null || hotspot.highlight == null) continue;
                bool showIcon = hotspot.IsOn() && KickStarter.stateHandler.IsInGameplay() && IsNearby(hotspot);
                if (showIcon) hotspot.highlight.HighlightOn();
                else if (KickStarter.playerInteraction.GetActiveHotspot() != hotspot && !hotspot.highlight.IsFlashing()) hotspot.highlight.HighlightOff();
            }
    
            bool IsNearby(Hotspot hotspot)
            {
                foreach (var nearbyHotspot in nearbyHotspots)
                {
                    if (nearbyHotspot == hotspot) return true;
                }
                return false;
            }
        }
    
    }
    
  • Thank you, it works well. On the other hand, what's strange is that in the editor there is no problem but when it's compiled, in the apk there is sometimes still a little flickering of the icon.

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.