Search Unity

Bug Toolkit doesn't survive scene reloads

Discussion in 'XR Interaction Toolkit and Input' started by Ofx360, Sep 29, 2021.

  1. Ofx360

    Ofx360

    Joined:
    Apr 30, 2013
    Posts:
    155
    After scene reloads i'm flooded with this error:

    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEngine.XR.Interaction.Toolkit.XRRayInteractor.UpdateSamplePoints (System.Int32 count, System.Collections.Generic.List`1[T] samplePoints) (at Library/PackageCache/com.unity.xr.interaction.toolkit@1.0.0-pre.6/Runtime/Interaction/Interactors/XRRayInteractor.cs:1426)
    3. UnityEngine.XR.Interaction.Toolkit.XRRayInteractor.ProcessInteractor (UnityEngine.XR.Interaction.Toolkit.XRInteractionUpdateOrder+UpdatePhase updatePhase) (at Library/PackageCache/com.unity.xr.interaction.toolkit@1.0.0-pre.6/Runtime/Interaction/Interactors/XRRayInteractor.cs:1340)
    4. UnityEngine.XR.Interaction.Toolkit.XRInteractionManager.ProcessInteractors (UnityEngine.XR.Interaction.Toolkit.XRInteractionUpdateOrder+UpdatePhase updatePhase) (at Library/PackageCache/com.unity.xr.interaction.toolkit@1.0.0-pre.6/Runtime/Interaction/XRInteractionManager.cs:242)
    5. UnityEngine.XR.Interaction.Toolkit.XRInteractionManager.Update () (at Library/PackageCache/com.unity.xr.interaction.toolkit@1.0.0-pre.6/Runtime/Interaction/XRInteractionManager.cs:165)
    Pretty annoying when you just want to test something. It seems like a list isn't being initialized in OnEnable.

    And i want to use the fast "Enter Play Mode" option, but I can never really know when Unity's stuff is actually compliant with Unity's own features, so i'm asking: Is Toolkit and OpenXR ok to use with Domain Reloads and Scene Reloads turned off? I don't want something to silently be breaking on me during testing that'll come to bite me later.