Forum rules - please read before posting.

Unity UI Interaction Appear on Hotspot on Working

I just downloaded the new Adventure Creator and Im having an issue were when I set the Position of interactions to on Hotspot, it just appears to follow the mouse cursor.

I tested this on my own custom ui and ht demo ui and it still didnt work.

Comments

  • I can't recreate such an issue - could you share screenshots of your Settings Manager, and the Menu's properties?





  • In the last screen, thats were the cursor is.

  • That is your cursor - not the menu.

    The Interaction menu will show if your "Interaction method" supports it. Context Sensitive doesn't trigger menus of the type "On Interaction" - instead, it's entirely cursor-based.

    You can prevent the cursor from changing to the Use icon by unchecking Change cursor based on Interaction? in the Cursor Manager.

    If you want to keep the same interaction method (i.e. single-click Hotspots to use them), but display a "Use" icon over the Hotspot, go to the Settings Manager's "Hotspot" panel and set Display Hotspot icons to Only When Highlighting.

    Hotspots will need to have a Highlight component assigned for them to display.

  • This is my own manager. I have this exact same setting in some old projects and i dont have a problem






    As you see its set to appear on the hotspot. Im using the multi hotspot label from the wiki.

  • edited March 16

    I can zip up and send you the project if you want. As you see, the interaction appears on the player in the middle of the screen and not on the hotspot cube

    In the demo, removed context sensitive and it does appear on the door hotspot.
    I noticed that the demo InteractionUI prefab has a Panel and Grid while the one AC made for me only has a Panel.

  • Here, your Settings Manager's Interaction method is set to Choose Hotspot Then Interaction, which does show the Interaction menu.

    The Settings Manager in your first screenshot has this set to Context Sensitive, which instead shows icons with the cursor.

  • The first screenshot was using the robot demo. After you mentioned Interaction Method was set to Context Sensitive, I set the interaction method to Choose Hotspot then Interaction, the interaction was positioned over the hotspot.

    But in my own UI which i posted above, the interaction method is set to Choose Hotspot then Interaction as seen in the screenshot but its still positioned in the middle of the screen.

  • Best see things directly. I don't need your project - PMing me a .unitypackage of your Managers, and the InteractionUI prefab, should be enough.

  • This is due to your custom script, InteractionOnNearest, which needs amending following the update:

    using UnityEngine;
    using AC;
    
    public class InteractionOnNearest : MonoBehaviour
    {
    
        public float minimumSqrDistance = 10f;
    
        private void Update ()
        {
            // Check if there is a player with a hotspot detector
            if (KickStarter.player && KickStarter.player.hotspotDetector)
            {
                // Read the nearest Hotspot to the detector
                Hotspot nearestHotspot = KickStarter.player.hotspotDetector.NearestHotspot;
    
                if (nearestHotspot && KickStarter.stateHandler.IsInGameplay () && (nearestHotspot.transform.position - KickStarter.player.hotspotDetector.transform.position).sqrMagnitude < minimumSqrDistance)
                {
                    // If there is a Hotspot nearby, and it's during gameplay, show Interaction menus for that Hotspot
                    KickStarter.playerMenus.EnableInteractionMenus (nearestHotspot);
                    KickStarter.playerInteraction.SetActiveHotspot (nearestHotspot);
                }
                else
                {
                    // Otherwise, close Interaction menus
                    KickStarter.playerMenus.CloseInteractionMenus ();
                    KickStarter.playerInteraction.SetActiveHotspot (null);
                }
            }
    
        }
    
    }
    
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.