Log in or register to post comments

Disabling VuforiaBehaviour component causes Null Reference Exception error to log each frame

June 21, 2021 - 1:28pm #1

I need to disable the VuforiaBehaviour script in my scene (in Unity), and do so with VuforiaBehaviour.Instance.enabled = false;. Every frame after this, an error is logged in the console "NullReferenceException: Object reference not set to an instance of an object."

I have no other custom scripts that make a direct mention of the VuforiaBehaviour script instance that could cause this, and this issue occurs anywhere I place the disable command, whether it be a coroutine or function or on Update(). Start() is the only function it could be placed without the issue occurring. Unfortunately I can't keep it in Start(). The issue occurs of the HoloLens 2, the intended device for the app, though I don't know if that plays a role.

Has anyone ran into this or something similar? Is there a proper method of toggling Vuforia that I'm missing? Any insights welcome.

Unity 2019.4.5

Vuforia 8.5.9 and 9.8.8 (tried updating to see if it helped)

HoloLens 2 

Log in or register to post comments