I am developing a VR App in Unity3D for HTC Vive Pro (Wireless) everything works well with VR in the usual way. (SteamVR Plugin 2.5.0 (SDK 1.8.19))
Except for some requirement reasons in the same Unity scene, I have to shutdown VR --> switch to Desktop mode and later at some point enable VR again. The moment, I enable it via script the VR display is ON, the HMD tracking works well but the Vive controllers are not tracked (position & rotation), I can see the controller model rendered though in the last position when the VR was shut down but I can't get the updated tracking. The issue is only happening in the Unity Build. In the editor, it is working fine now after this change.
To fix the issue in the Unity Editor: I tried changing the SteamVR_ActivateActionSetOnLoad method from Start() to OnEnable() as the error on re-enabling was related to controller actions missing, that is now fixed cause of this change. e-g
private void OnEnable()
{
if (actionSet != null && activateOnStart)
{
//Debug.Log(string.Format("[SteamVR] Activating {0} action set.", actionSet.fullPath));
actionSet.Activate(forSources, 0, disableAllOtherActionSets);
}
}
I am looking for a solution, to fix the issue in the Unity build? Any suggestions are highly appreciated.