Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

Prefix Cursor Labels

Hi,

I am working on a project that has interaction and then hotspot as the interaction method. I also have the verbs prefixed to the hotspot text and I have the appear type of the hotspot set to "On Hotspot". The problem I am running into is that I want the hotspot text to only be shown when the mouse is in fact hovering over a hotspot. But if I have the verbs prefixed, they always show regardless of this. So I would get "look at door" if hovering over a door with the look cursor selected, but would get simply "look" if I am not hovering over any hotspot. I'd prefer for nothing to be shown in the latter case.

Is this the default functionality and, if so, how could I override it?

Selene

Comments

  • edited February 17

    It is the default functionality - though I understand the argument for an alternative.

    You should be able to override it, however, by locking the Menu whenever you aren't hovering over a Hotspot, and when the Hotspot label isn't set by a Menu:

    using UnityEngine;
    using AC;
    
    public class LockHotspotMenuExample : MonoBehaviour
    {
    
        Menu hotspotMenu;
    
        void Start ()
        {
            hotspotMenu = PlayerMenus.GetMenuWithName ("Hotspot");  
        }
    
        void Update ()
        {
            if (KickStarter.playerInteraction.GetActiveHotspot () == null &&
                KickStarter.playerMenus.GetHotspotLabel () == KickStarter.playerInteraction.InteractionLabel)
            {
                hotspotMenu.isLocked = true;
            }
            else
            {
                hotspotMenu.isLocked = false;
            }
        }
    
    }
    
  • Couldn't try this until now, but it worked. Thanks.

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.
Do NOT follow this link or you will be banned from the site!