Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ParrelSync on OpenXR with SteamVR #77

Open
Maciej92Zareba opened this issue Apr 8, 2022 · 2 comments
Open

Using ParrelSync on OpenXR with SteamVR #77

Maciej92Zareba opened this issue Apr 8, 2022 · 2 comments

Comments

@Maciej92Zareba
Copy link

Hi I though I'm gona share solution on using ParrelSync when using SteamVR. SteamVR allows only 1 active connection to it so in order to use it With ParrelSync you need to disable VR on one of your mashine and enable it on other. Here is script I'm using for it. (Unity 2021.2.19)

using Sirenix.OdinInspector;
using System.Collections;
using UnityEngine.XR.Management;

public class VRUtilities : ExtendedMonoBehaviour
{
	[Button]
    public void EnableXR ()
	{
        StartCoroutine(StartXRCoroutine());
	}

	[Button]
	public void DisableXR ()
	{
        Logger.Log("Stopping XR...");
        XRGeneralSettings.Instance.Manager.StopSubsystems();
        XRGeneralSettings.Instance.Manager.DeinitializeLoader();
        Logger.Log("XR stopped completely.");
    }

    public IEnumerator StartXRCoroutine ()
    {
        Logger.Log("Initializing XR...");
        yield return XRGeneralSettings.Instance.Manager.InitializeLoader();

        if (XRGeneralSettings.Instance.Manager.activeLoader == null)
        {
            Logger.LogError("Initializing XR Failed. Check Editor or Player log for details.");
        }
        else
        {
            Logger.Log("Starting XR...");
            XRGeneralSettings.Instance.Manager.StartSubsystems();
        }
    }
}
@imbeyondboredom
Copy link

Important note here - In order for this to work you also need to disable VR on startup:
[Edit]->[Project Settings] -> [XR Plug-in Management] -> Select the desktop tab -> Uncheck "Initialize XR on Startup"

For me it's still a bit finnicky where sometimes steamvr doesn't close out the old game but it does work!

InkedUnity_ZYoVn3fxRO

@Maciej92Zareba
Copy link
Author

Ye, I forgot to add it here. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants