Forum rules - please read before posting.

Hiding cursor when camera is moving

edited May 2023 in Technical Q&A

I'm trying to build a feature to temporarily disable the cursor and hotspot labels - the cursor still works and hotspots highlight, they are just invisible. This is the code I have so far

            if (AC.KickStarter.cursorManager.cursorDisplay == CursorDisplay.Never)
            {
                AC.KickStarter.cursorManager.cursorDisplay = CursorDisplay.Always;
                AC.PlayerMenus.GetElementWithName("Hotspot", "HotspotLabel").IsVisible = true;
            }
            else
            {
                AC.KickStarter.cursorManager.cursorDisplay = CursorDisplay.Never;
                AC.PlayerMenus.GetElementWithName("Hotspot", "HotspotLabel").IsVisible = false;

            }

This works, except the cursor turns back on during camera transitions and over hotspots. I can Fix this by changing the size of the Hotspot and Cutscene cursor in the cursor manager, but I can't figure out how to access those two cursors by script. AC.KickStarter.cursorManager.GetCursorIconFromID(0) only seems to work for the list of interaction cursors.

Comments

  • The "cursorDisplay" property refers only to the "main" cursor.

    You can get API references to the Hotspot and Cutscene cursors by right-clicking their texture fields:

    AC.KickStarter.cursorManager.mouseOverIcon
    AC.KickStarter.cursorManager.waitIcon
    

    Alternatively, you can disable the entire cursor system completely with:

    AC.KickStarter.stateHandler.SetCursorSystem (false);
    

    If you're using Software cursor rendering, that should prevent any rendering.

    If you're using Hardware, you'd then have to separately hide the Unity cursor, which can be done with:

    Cursor.visible = false;
    
  • Works perfectly, thank you!

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.