Search Unity

Focus Loss Issue with (New) Input System / TrackedDeviceRaycaster

Discussion in 'Input System' started by plmx, Aug 7, 2022.

  1. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    308
    Hi,

    In Unity 2019.4 LTS, using InputSystem/Plugins/UI classes TrackedDeviceRaycaster and InputSystemUIInputModule classes: How can I convince the system to keep working (controller moves, button presses) even if the game window (editor or build, but specifically build) loses focus?

    We use a TrackedDeviceRaycaster with default settings on each Canvas, and a central EventSystem and InputSystemUIInputModule. This works fine for movement tracking + clicks - as long as the game window has focus. If it loses focus, Raycast() in TrackedDeviceRaycaster is not even being called. It seems from stacktrace debugging that in InputSystemUIInputModule.ProcessPointer(), state.changedThisFrame is no longer true if there is no focus.

    Can someone point out to me why this is happening and how to change this? While this is not an issue on standalone VR, we do have issues on PC with opening browser windows or other support tools which lead to the game not having focus anymore.

    If the "way to go" is not using that new input system, what should we use?

    Thanks,

    Philip
     
  2. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    308
    Last edited: Aug 11, 2022