You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: NetworkSpawnManager.OnDespawnObject removing parent on client-side (#2252)
* fix
Fixes issue where despawning a parent NetworkObject would try to remove itself from the child on the client-side.
* test
Adding a test to verify this fix
NetworkLog.LogError($"{nameof(NetworkObject)} #{spawnedNetObj.NetworkObjectId} could not be moved to the root when its parent {nameof(NetworkObject)} #{networkObject.NetworkObjectId} was being destroyed");
m_ErrorValidationLog.Append($"[Client-{clientHandler.NetworkManager.LocalClientId}] {nameof(NetworkObject)}-{clientHandler.NetworkObjectId}'s scale {clientHandler.transform.localScale} does not equal the server-side scale {serverHandler.transform.localScale}");
varshouldNotBeSpawned=isStillSpawnedCheck?" and is still spawned!":string.Empty;
84
85
if(!shouldHaveParent)
85
86
{
86
-
m_ErrorValidationLog.Append($"[{serverOrClient}-{handler.NetworkManager.LocalClientId}] {nameof(NetworkObject)}-{handler.NetworkObjectId}'s still has the parent {handler.transform.parent.name} when it should be null!");
87
+
m_ErrorValidationLog.Append($"[{serverOrClient}-{handler.NetworkManager.LocalClientId}] {nameof(NetworkObject)}-{handler.NetworkObjectId}'s still has the parent {handler.transform.parent.name} when it should be null{shouldNotBeSpawned}!");
Assert.True(sceneEventStartedStatus==SceneEventProgressStatus.Started,$"Failed to load scene {k_TestSceneToLoad} with a return status of {sceneEventStartedStatus}.");
0 commit comments