Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Virtual Mouse Not Triggering OnPointerEnter events

Discussion in 'Input System' started by Jose-Abalos, Nov 10, 2023.

  1. Jose-Abalos

    Jose-Abalos

    Joined:
    Jan 31, 2014
    Posts:
    6
    Hi all, I need to do a virtual mouse that you can control with a gamepad. If I play on PC, I use the regular cursor, whereas if I'm playing on a keyboard I use the virtual mouse.
    I found the following tutorial which was useful in setting it up:
    .

    And I can move it around, but I'm having trouble selecting a Button that is on a scaled canvas. The Button has a script that logs debug messages with OnPointerEnter and OnPointerExit events. We're using the solution suggested by KinecticBen here: https://forum.unity.com/threads/virtual-mouse-and-canvas-scaler-scale-with-screen-size.1128836/
    Regardless to say, these debug messages trigger when I select the button with a PC mouse. The weird thing that I'm noticing is that using the Input Debugger, the virtual mouse and the PC mouse are both on the same position when hovering above the Button.

    What else I might be missing here? Anyone else had a similar problem?