Skip to content

Commit 4ef984a

Browse files
guarding the location of despawn with a spawn check
1 parent 911643f commit 4ef984a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Packages/com.unity.multiplayer.samples.coop/Utilities/SceneManagement/LoadingProgressManager.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,10 @@ void RemoveTracker(ulong clientId)
143143
{
144144
var tracker = ProgressTrackers[clientId];
145145
ProgressTrackers.Remove(clientId);
146-
tracker.NetworkObject.Despawn();
146+
if (tracker.NetworkObject.IsSpawned)
147+
{
148+
tracker.NetworkObject.Despawn();
149+
}
147150
ClientUpdateTrackersRpc();
148151
}
149152
}

0 commit comments

Comments
 (0)