Search Unity

Bug UWP Mouse Position offset

Discussion in 'Input System' started by Andrew-Kite, Aug 7, 2020.

  1. Andrew-Kite

    Andrew-Kite

    Joined:
    Oct 16, 2014
    Posts:
    34
    Hi everyone,

    I have been having some issues with the new input system for my UWP build. In the editor everything works fine, along with my iOS and Android builds using Touch Position in place of Mouse Position.

    However, when I build to UWP, my mouse position is offset along Y, and I am required to make selections above where I need to select.

    They way I use the mouse position is as follows;

    this.pointerPosition = obj.ReadValue<Vector2>();
    RaycastHit2D hit = Physics2D.Raycast(
    MainCamera.ScreenToWorldPoint(this.pointerPosition),
    Vector2.zero);


    I have no processors attached to the Mouse action, and the offset occurs regardless of full screen or windowed mode.
    Using Unity 2019.4.3f1 (also tested using latest 2020 build), and Input System 1.0.0

    Any help would be appreciated!
     
  2. Andrew-Kite

    Andrew-Kite

    Joined:
    Oct 16, 2014
    Posts:
    34
    Submitted bug report. Case number is 1269426

    Attempted to set the action type as both Passthrough, and Value. No change.
    Capture1.PNG Capture2.PNG

    As a test, I downloaded the Visualizer sample and built to UWP. Here is a screenshot of where the cursor is being detected as point 0,0.
    untitled.png
     
    Last edited: Aug 10, 2020
  3. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Thank you for filing the ticket. Needs looking at.
     
    Andrew-Kite likes this.
  4. TigerSkyThief

    TigerSkyThief

    Joined:
    Jun 25, 2020
    Posts:
    2
    I am having the same issue

    How do I fix this?
     
  5. Andrew-Kite

    Andrew-Kite

    Joined:
    Oct 16, 2014
    Posts:
    34
    I would assume a quick solution would be to apply a Processor to the Mouse Position Action, keeping X as 1, and Y as 1.333 (or whatever the difference is to offset it to the correct position).

    I have decided to wait for a bug fix, as I am unsure how this could be affected on different versions of Windows and machines. Hopefully we can get a fix soon as this is the last thing I need to do before uploading my build to the Microsoft Store :)
     
  6. Andrew-Kite

    Andrew-Kite

    Joined:
    Oct 16, 2014
    Posts:
    34
    Might there be an update on this issue, or a more ideal work around?