ValveSoftware / steamvr_unity_plugin

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

Always crash when play the VR Sample scene #808

Open duanyunlun opened 3 years ago

duanyunlun commented 3 years ago

1,Dev Environment: Unity 2019.4.8f1 LTS ,with these packages image

2,Hardware : i9 9900K + RTX 2080 + 64G RAM (2666Mhz)

3,Frequency of occurrence : everytime

4,Steps to reproduce: 1) Download and import OpenVR-XR-Plugin-Installer.unitypackge and steamvr_2_6_1.unitypackage from offical github sites; 2) Open UnityHub to create a new project with URP template; 3) Import 1)downloaded packages; 4) Generate SteamVR Input modules; 5) Open the SteamVR Interactable Sample Scene and play, then Crash. Actually ANY SCENE WITH VR MODULE WILL CRASH!

duanyunlun commented 3 years ago

Here is a workaround: 1, Open any Scripts in the Project, then press "Ctrl + Alt + P" to Attach to the Unity.exe process; image image

2, Back to Unity and click Play, you shell get the Debugger reaction,like this: image

3, Then stop the Debugger, Unity will keep running rather than CRASH WITHOUT WARNING.

PS: Actually there is an ErrorLog always shows after Click Play, like below: image image image

It's an ERROR that shows the Teleport.instance NULL when other script try to get it, I don't know if there is a relationship between the two。

zite commented 3 years ago

This seems like it's probably a unity issue. As you can see, instance should never be null in that scene.

On Wed, Aug 12, 2020 at 8:13 PM duanyunlun notifications@github.com wrote:

Here is a workaround: 1, Open any Scripts in the Project, then press "Ctrl + Alt + P" to Attach to the Unity.exe process; [image: image] https://user-images.githubusercontent.com/15923235/90089909-3a66dd80-dd55-11ea-9d6a-f3e0b9369090.png [image: image] https://user-images.githubusercontent.com/15923235/90089928-45ba0900-dd55-11ea-8df2-d69b4aaf77b6.png

2, Back to Unity and click Play, you shell get the Debugger reaction,like this: [image: image] https://user-images.githubusercontent.com/15923235/90090004-7601a780-dd55-11ea-8dc3-4a8ca5f0136d.png

3, Then stop the Debugger, Unity will keep running rather than CRASH WITHOUT WARNING.

PS: Actually there is an ErrorLog always shows after Click Play, like below: [image: image] https://user-images.githubusercontent.com/15923235/90090091-b8c37f80-dd55-11ea-946a-c5a1e6a8a8f7.png [image: image] https://user-images.githubusercontent.com/15923235/90090113-c2e57e00-dd55-11ea-9ca4-805a9b73acbc.png [image: image] https://user-images.githubusercontent.com/15923235/90090193-00e2a200-dd56-11ea-86a2-76f15cbdbe64.png

It's an ERROR that shows the Teleport.instance NULL when other script try to get it, I don't know if there is a relationship between the two。

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ValveSoftware/steamvr_unity_plugin/issues/808#issuecomment-673224285, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABQQMHEKRYUBDBX7ZGHMRDSANK6TANCNFSM4P5VPLEQ .

duanyunlun commented 3 years ago

This seems like it's probably a unity issue. As you can see, instance should never be null in that scene.

In fact, The UpdateVisuals() was called in the TeleportPoint.cs's Awake() Method, When I move it to the Start() Method, these ERROR no longer occurs image

Because Awake() doesn't guarantee the calling order, so instance may still be empty

PS: I try to look deeper to find the source, found out that image The last two line ERROR are my own code to verify the calling order, don't know why the TeleportPoint's Awake was called by the SDK Loader, please check.

nhf75 commented 3 years ago

Try to set Rendering Path to Foward in your Camera, OpenVr Stereo Rendering Mode to Multi Pass and Mirror View Mode to None.

duanyunlun commented 3 years ago

Try to set Rendering Path to Foward in your Camera, OpenVr Stereo Rendering Mode to Multi Pass and Mirror View Mode to None.

But this loses the meaning of using URP lol

nhf75 commented 3 years ago

Yes, but this the only way to stop crash to continue you development until new release come. Unfortunately.

zite commented 3 years ago

When instance is called, if it is null for some reason it should scan the hierarchy for any teleport object and use that. If you have a teleport object in your scene then instance should never be null.