Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
  4. Join us on Thursday, September 29, for a day with Unity's SRP teams here on the forum or on Reddit, and discuss topics around URP, HDRP, and the Scriptable Render Pipeline in general.
    Dismiss Notice

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:
    306
    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:
    306
    Last edited: Aug 11, 2022
unityunity