Unity 2020.2 with HTC Vive Pro
Hello. I am developing a multiplayer VR game which has a simple lobby scene where the player types in their name and clicks a button. Once all players are ready a start game button is clicked and a new scene is loaded where the XR Rig allows exploration.
When testing I keep being troubled by the same problem; at the lobby scene the text input field and the associated button are not recognised. Sometimes if I restart my computer, restart SteamVR and run the build it works, but mostly it doesn’t. I am using the New Input System and have set my Player Settings to Both.
I feel it is somehow related to the OpenXR requirement to set the Window > Analysis > Input Debugger > Options > Lock Input to Game View. I didn’t have any problems during my early development but it has surfaced recently and may be around the time when SteamVR updated (though this could be completely unrelated). It’s incredibly frustrating and I have no idea what could be the solution. Any suggestions or advise would be very welcome please.
Update
On further testing I have found that if I switch my Vive hand controllers off and start the game the keyboard and mouse are recognised. With the hand controllers switched on I can’t edit the text or click the button.
Hey there @chris-tdc - as Vive support is handled directly by HTC, you should share this on their developer forums so their teams can help.
I solved my problem where the HTC Vive Hand Controllers disabled my keyboard and mouse as follows:
First I went into Project Settings > XR Plug-in Management and switched off Initialize XR on Startup. In my game scene, which is loaded when everyone leaves the Lobby, I added an empty GameObject called XRManagement and attached a script to it. My script is as follows:
public class XRManagementScript : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
Debug.Log("XrManagementScript.Start called.");
// Initialise the XR System.
XRGeneralSettings.Instance.Manager.InitializeLoaderSync();
XRGeneralSettings.Instance.Manager.StartSubsystems();
}
private void OnDestroy()
{
Debug.Log("Stopping XR...");
XRGeneralSettings.Instance.Manager.StopSubsystems();
XRGeneralSettings.Instance.Manager.DeinitializeLoader();
Debug.Log("XR stopped completely.");
}
}
Now when the application is launched the XR system is not running so the keyboard and mouse work fine for logging in. Once the players proceed into the game scene the XR system is started and the XR Rig works fine.
Hope this helps someone.
1 Like
For people who want the input both for Mouse and Controllers in EventSystem change Pointer Behavior to “All Pointers As Is”. Helped me. Hope, it helps you too.
It was a Unity thing after all, not Vive.

1 Like