简体   繁体   中英

Steam VR Scene stops responding on reload in Unity

I have a scene that I'm working on using Steam VR 2.0, and Unity 2018.3.2f1. I have a simple statement in it that reloads the scene

private void Update()
    {
        if (Input.GetKeyDown(KeyCode.R))
        {
            SceneManager.LoadSceneAsync("Final");
        }
    }

The issue is: when I reload the scene, it stops responding properly. I am still able to move my head around, and hover over objects. And the objects I hover over get highlighted, but they stay highlighted . I'm not able to pick them up, or interact with them in any meaningful way, and I don't know why this is happening.

I've attached a screenshot of the issue below.

As you can see, multiple objects are highlighted, and the hand mesh is weird:

在此处输入图片说明

Solutions I've tried--

  • Using LoadScene instead of LoadSceneAsync
  • Using Application.LoadScene instead
  • Tried to edit the Player script in SteamVR library to not add it to Don't Destroy On Load

Any suggestions?

The issue was arising because the Player prefab in SteamVR 2.0 had Do Not Destroy on Load checked. So, there were multiple players being instanced when I reloaded the scene. I unchecked that box, and now everything is in order.

The checkbox is located inside the [SteamVR] object under the Player prefab: 该复选框位于 <code>Player</code> 预制件下的 <code>[SteamVR]</code> 对象内

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM