3
\$\begingroup\$

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.

\$\endgroup\$
4
  • \$\begingroup\$ A question, how do you disable VR, and what are your conceptual requirements for disabling it? Outside of that, if you don't find a proper way to solve it, had you tried brute-force reloading the whole scene in Unity when VR is re-enabled to see if that fixes it? \$\endgroup\$ Commented Feb 2, 2020 at 19:52
  • 1
    \$\begingroup\$ Hi Philipp, the same environment scene is used in both Desktop and VR mode. Its a neuroscience research project. So, in order to keep things simple, we created one scene and managed via script to control the different modes of the project. It was working fine in the previous Steam VR plugin, but after upgrading everything to Steam 2.5.0 as the input actions loading have changed, the controller stopped working. \$\endgroup\$ Commented Feb 4, 2020 at 10:10
  • \$\begingroup\$ @PhilippLenssen "had you tried brute-force reloading the whole scene in Unity when VR is re-enabled to see if that fixes it?" I have not done this yet, but I will try and update here. \$\endgroup\$ Commented Feb 4, 2020 at 10:13
  • \$\begingroup\$ Update: I have tried reloading the current scene again when VR is enabled, but it doesn't fix the issue. \$\endgroup\$ Commented Mar 2, 2020 at 13:43

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.