I few lectures later I realized I had missed the “break;” in OnPlayerDespawned. This caused the error:
ObjectDisposedException: The Unity.Collections.NativeList`1[LeaderboardEntityState] has been deallocated, it is not allowed to access it
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckReadAndThrowNoEarlyOut (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) <0x43e9d9e50 + 0x0003f> in <fce8379edca44956857fe8bfa087cd3f>:0
Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckReadAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Jobs/AtomicSafetyHandle.bindings.cs:184)
Unity.Collections.NativeArray`1+Enumerator[T].MoveNext () (at /Users/bokken/build/output/unity/unity/Runtime/Export/NativeArray/NativeArray.cs:370)
Leaderboard.OnPlayerDespawned (TankPlayer tankPlayer) (at Assets/_Project/Scripts/UI/Leaderboard/Leaderboard.cs:75)
TankPlayer.OnNetworkDespawn () (at Assets/_Project/Scripts/Core/Player/TankPlayer.cs:45)
So be sure to add the break as Nathan instructs!
Thanks,
Julian