Search Unity

Bug Gamepad UI Actions Always Use Lower Left Pointer Position

Discussion in 'Input System' started by leea1, Jan 20, 2023.

  1. leea1

    leea1

    Joined:
    May 13, 2020
    Posts:
    12
    I am using the
    InputSystemUIInputModule
    with the standard UI action map, updating the
    Click
    and
    RightClick
    actions to use the gamepad L/R triggers. I am attempting to click on WorldSpace UI.

    Because the scheme is Gamepad, it seems to just use the lower left, presumably
    (-1, -1)
    , as the pointer position. I am able to click my worldspace UI if I orient my player/camera such that the UI is in the bottom left...

    This is regardless of the cursor being
    Locked
    and the
    InputSystemUIInputModule Cursor Lock Behavior = Screen Center


    When not locked, I use the thumbstick to drive the mouse cursor via
    WarpCursorPosition
    and update the Input System state via
    InputState.Change(Mouse.current.position,...)
    . Still all clicks go to the bottom left...

    Any suggestions/workarounds?
     
  2. leea1

    leea1

    Joined:
    May 13, 2020
    Posts:
    12
    Found a workaround... add the "Gamepad" scheme to the
    Point
    binding to
    Position [Mouse]
    .

    I think what's going on is there is no pointer associated with a Gamepad, so when "Gamepad" is the current scheme, it just defaults the pointer data (I actually guess it's
    (0, 0))
    now), but keeping the mouse point binding active while using the Gamepad scheme, keeps an actual pointer around.

    Probably could use a virtual mouse, but that's the same difference, I'd just have to add that device/binding as enabled when in Gamepad scheme.