Search Unity

Locked visible Cursor

Discussion in 'Navigation' started by TimoMattes, May 6, 2022.

  1. TimoMattes

    TimoMattes

    Joined:
    Feb 14, 2022
    Posts:
    3
    Hello everybody,

    I want to lock my cursor to the middle of my screen but still have it visible.
    Reason is, that in my game are lots of Buttons to click, therefore I want the Cursor visible all the time, to be able to click on UI-elements.
    If I use
    Code (CSharp):
    1. Cursor.lockState = CursorLockMode.Locked;
    2. Cursor.visible = true;
    the cursor is not visible (In Editor/Playmode but also after build/WebGL).

    How is it possible to pin the cursor to the center but leave it visible?

    Thanks!!
     
  2. DwinTeimlon

    DwinTeimlon

    Joined:
    Feb 25, 2016
    Posts:
    300