ValveSoftware / steamvr_unity_plugin

SteamVR Unity Plugin - Documentation at: https://valvesoftware.github.io/steamvr_unity_plugin/
BSD 3-Clause "New" or "Revised" License
1.03k stars 256 forks source link

Controllers freeze when switching scenes #222

Closed indus closed 5 years ago

indus commented 5 years ago

When I switch from on scene to another my controllers freeze. No pose-updates or button interactions are possible. Headtracking works fine. I tried SteamVR_Loadlevel.Begin and pure SceneManager.LoadScene. I also get an error: Failed to load IVRRenderModels interface version IVRRenderModels_006

SteamVR Plugin v2.1 HTC Vive - Standard

indus commented 5 years ago

In fact I wanted to copy the camerarig over to the new scene but I am unable to do so...

zite commented 5 years ago

Looks like that error is unrelated. What scene are you trying to switch out of? I tested this in the Interaction Sample scene and it worked for me. Are there any other errors?

indus commented 5 years ago

I think I just had problems with "SceneManager.MoveGameObjectToScene". With "DontDestroyOnLoad" i have a working solution now. Sorry for bothering you with this non-issue :sweat_smile:

BenWoodford commented 5 years ago

I to had this issue but found the cause - you have to carry over the [SteamVR] prefab between scenes otherwise it has to be re-created (which is why I was able to get controllers to track again by toggling the component as that calls SteamVR.Initialize()

It's not a bug so much as something you have to do to handle scene-switching as out of the box the camera rig doesn't switch scenes either. Thought I'd post it here for anyone who needs it.

indus commented 5 years ago

@BenWoodford Thanks! I will try your solution. Edit: Or wait for the fix ;-)

zite commented 5 years ago

Ah that makes sense. I'll add a checkbox to the component for DoNotDestroy.

BenWoodford commented 5 years ago

@zite probably worth adding one to the CameraRig too, and if the [SteamVR] object is spawned in automatically rather than already part of the scene, copy the settings over from the CameraRig.

zite commented 5 years ago

I've added this checkbox in the 2.2b4 beta on the releases page: https://github.com/ValveSoftware/steamvr_unity_plugin/releases/tag/2.2b4

zite commented 5 years ago

This is now in the latest release