question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pointer broken on scene switch for WMR

See original GitHub issue

Environment

  • 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:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
SimonDarksideJcommented, Apr 30, 2018

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 current master in Unity 2017.4.1 - fail
  • Tested original commit for WMR in Unity 2017.4.1 - fail
  • Built for WMR and Run the UWP project naively - WORKS

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.

0reactions
SimonDarksideJcommented, Apr 30, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cursor disappears when you bring up articulated hands set ...
If you set up articulated hands to use V1 GGV pointer, when you bring up your hands, the cursor will disappear. Fix is...
Read more >
LaserPointer doesnt work after switching scenes.
I have 2 scenes in my project, one for the menu and one for the game itself, when separated they work perfectly but...
Read more >
Mouse Cursor Issue in VR (HP Reverb G2) - Virtual Reality
The fix for me was to activate one of the hand controllers and then press the windows button (on the hand controller) to...
Read more >
Mouse Pointer Bug?
1- Move the game tab between the scene and the Inspector Tab. 2- Move the mouse pointer from Scene to Game and the...
Read more >
Windows mouse, pointer broken
Solutions to fix corrupted mouse pointer 1. Select the Display Pointer Trails ... You can turn off the screensaver in Windows 10 as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found