Pointer broken on scene switch for WMR
See original GitHub issueEnvironment
- VRTK cloned from Github
- Commit 97cc00b4f0183c23574374d5635eb0baeefd7a78 (latest as of 4/27)
- Unity v2017.2.2f1
- WMR Samsung Odyssey
- VRTK-Windows-MR-Extension release 3.3.0 (.unitypackage from Releases)
Steps to reproduce
- Clone master branch of VRTK
- Import VRTK-Windows-MR-Extension from Releases
- Open VRTK > Examples > VRTK_SDKManager_Constructor
- Follow all instructions in Getting started and WMR SDK setup
Scenario One
- Open VRTK > Examples > [001 - Interactions] ControllerEvents
- Enter Play mode
- Switch scenes (press spacebar)
Scenario Two
- Open VRTK > Examples > [002 - Pointers] StraightPointer
- Enter Play mode
- Switch scenes (press spacebar)
Scenario Three
- Open VRTK > Examples > [003 - Pointers] BezierPointer
- Enter Play mode
- Switch scenes (press spacebar)
Expected behavior
Scenario One Scene 001 shouldn’t have any Pointer functionality. When you switch to scene 002, you should be able to use the Pointer by touching the touchpad.
Scenario Two You should be able to use the Pointer in Scene 002 by touching the touchpad. When you switch to scene 003, you should be able to use the Pointer by touching the touchpad.
Scenario Three You should be able to use the Pointer in Scene 003 by touching the touchpad. When you switch to scene 004, you should be able to use the Pointer by touching the touchpad.
Current behavior
Scenario One Scene 001 is fine. The Pointer doess not appear in scene 002. No errors appear.
Scenario Two The Pointer appears and operates correctly in scene 002, but throws an error in scene 003:
MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
VRTK.VRTK_BasePointerRenderer.GetOrigin (Boolean smoothed) (at Assets/VRTK/Source/Scripts/Pointers/PointerRenderers/VRTK_BasePointerRenderer.cs:402)
VRTK.VRTK_StraightPointerRenderer.CastRayForward () (at Assets/VRTK/Source/Scripts/Pointers/PointerRenderers/VRTK_StraightPointerRenderer.cs:200)
VRTK.VRTK_StraightPointerRenderer.UpdateRenderer () (at Assets/VRTK/Source/Scripts/Pointers/PointerRenderers/VRTK_StraightPointerRenderer.cs:62)
VRTK.VRTK_Pointer.HandleEnabledPointer () (at Assets/VRTK/Source/Scripts/Pointers/VRTK_Pointer.cs:375)
VRTK.VRTK_Pointer.Update () (at Assets/VRTK/Source/Scripts/Pointers/VRTK_Pointer.cs:337)
Scenario Three The Pointer appears and operates correctly in scene 003, but throws an error in scene 004:
MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
VRTK.VRTK_BasePointerRenderer.GetOrigin (Boolean smoothed) (at Assets/VRTK/Source/Scripts/Pointers/PointerRenderers/VRTK_BasePointerRenderer.cs:402)
VRTK.VRTK_BezierPointerRenderer.ProjectForwardBeam () (at Assets/VRTK/Source/Scripts/Pointers/PointerRenderers/VRTK_BezierPointerRenderer.cs:209)
VRTK.VRTK_BezierPointerRenderer.UpdateRenderer () (at Assets/VRTK/Source/Scripts/Pointers/PointerRenderers/VRTK_BezierPointerRenderer.cs:79)
VRTK.VRTK_Pointer.HandleEnabledPointer () (at Assets/VRTK/Source/Scripts/Pointers/VRTK_Pointer.cs:375)
VRTK.VRTK_Pointer.Update () (at Assets/VRTK/Source/Scripts/Pointers/VRTK_Pointer.cs:337)
Bonus Info:
Same exact setup was tested with SteamVR + Vive as well as SteamVR + Odyssey (WMR) with NO issues (behaved as expected).
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
And the prize for the thing that creates the most bugs in software goes to… Unity. Who could have imagined it, 10 years straight. This is yet another Unity bug, nothing wrong with VRTK.
Tested BOTH by using keyboard and using the Button 2 (menu) + Touchpad + Trigger methods.
If you run it in Unity, the buttons stop working. Built for the platform, no issues.
When I last tested this was with 2017.3.1 (I think), so, yet again something has been enhanced and broken this in the editor.
No, you shouldn’t need a custom version. However, it is a Unity bug, not a bug for VRTK as it works in the runtime build.