I’m getting this error when Unloading a scene with the object on it. I know its a networklist but have not been able to track down whats causing this. I’m clearing all lists before destroying the object. Any ideas?
ObjectDisposedException: The Unity.Collections.NativeList`1[Unity.Netcode.NetworkBehaviourReference] has been deallocated, it is not allowed to access it
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckDeallocateAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at <ad50157ee00e45cdb3c8bd67012f8804>:0)
Unity.Collections.LowLevel.Unsafe.DisposeSentinel.Dispose (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle& safety, Unity.Collections.LowLevel.Unsafe.DisposeSentinel& sentinel) (at <ad50157ee00e45cdb3c8bd67012f8804>:0)
Unity.Collections.NativeList`1[T].Dispose () (at Library/PackageCache/com.unity.collections@1.1.0/Unity.Collections/NativeList.cs:532)
Unity.Netcode.NetworkList`1[T].Dispose () (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.5/Runtime/NetworkVariable/Collections/NetworkList.cs:474)
Unity.Netcode.NetworkBehaviour.OnDestroy () (at Library/PackageCache/com.unity.netcode.gameobjects@1.0.0-pre.5/Runtime/Core/NetworkBehaviour.cs:678)
Game.Encounter.OnDestroy () (at Assets/Game/Scripts/Shared/Gameplay/Encounter/Encounter.cs:131)
Game.CombatEncounter.OnDestroy () (at Assets/Game/Scripts/Shared/Gameplay/Encounter/CombatEncounter.cs:343)