Search Unity

Question OnPointerEnter doesn't work with CursorLockMode.Locked

Discussion in 'Input System' started by DeeCeptor, Nov 15, 2022.

  1. DeeCeptor

    DeeCeptor

    Joined:
    Aug 4, 2013
    Posts:
    33
    I'm using Unity's newer input system (InputSystemUIInputModule), and when:

    Code (CSharp):
    1. Cursor.lockState = CursorLockMode.Locked;
    The camera has a PhysicsRaycaster attached

    OnPointerEnter and UI events do not trigger when the center of the screen (and the hidden centered cursor) is over UI. OnMouseOver/Enter/Exit events play with Collider's marked as triggers, but OnPointerEnter does not.

    I've searched other questions on this topic here, but none have a satisfactory answer (one old answer mentioned a custom physics raycaster and custom input module, but the new input module is now different).

    Any help would be appreciated