Search Issue Tracker

Fixed in 5.3.0

Votes

3

Found in

4.6.1f1

Issue ID

654942

Regression

No

Custom cursor appears on Android even when trying to hide it

Android

-

If custom cursor is set in project, it appears in Android builds too and it cannot be hidden in any way

Comments (3)

  1. ashishsfb

    Apr 27, 2017 17:17

    I'm using mouse in my android game using micro USB to USB Female cable using Unity 5.6. I only want to have zoom capability using the scroll wheel and don't want the cursor to be visible in the game.
    I tried both ways, only using Cursor.visible = false; and the above mentioned solution. But in both the cases the mouse cursor remains present, while both ways work inside editor none in android, Please guide me if I need something else to do.

  2. d_kieffer

    Jul 20, 2015 20:44

    We are having this exact same problem. If we cannot figure a proper solution, we'll try KepAmun's workaround.

    (Using Unity 5.0.2f1)

  3. KepAmun

    May 20, 2015 17:12

    You could, of course, just clear the custom cursor before you build for Android each time, but I don't want to have to remember to do that each time I switch between mobile and stand-alone platforms.

    Since Cursor.visible = false and Cursor.SetCursor(null... both seems to do nothing on Android, I made a work around; set the custom cursor texture to a single transparent pixel at run time.

    Put this in Start() or Awake() of a script attached to a GameObject in your first scene:
    if(Application.isMobilePlatform)
    {
    Cursor.visible = false; // Once Android cursor bug is fixed, you can delete the next 3 lines.
    Texture2D cursorTexture = new Texture2D(1, 1);
    cursorTexture.SetPixel(0, 0, Color.clear);
    Cursor.SetCursor(cursorTexture, Vector2.zero, CursorMode.Auto);
    }

    (Using Unity 5.0.1f1)

Add comment

Log in to post comment