Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions com.unity.netcode.gameobjects/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ Additional documentation and release notes are available at [Multiplayer Documen
### Changed


## [2.4.3] - 2025-06-25

### Fixed

- Fixed issue where spawned objects with `NetworkObject.DontDestroyWithOwner` set to `false` would not be destroyed when using a client-server network topology. (#3522)


## [2.4.2] - 2025-06-13

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1177,8 +1177,7 @@ internal void OnClientDisconnectFromServer(ulong clientId)
if (ownedObject)
{
// If destroying with owner, then always despawn and destroy (or defer destroying to prefab handler)
// Handle an object with no observers other than the current disconnecting client as destroying with owner
if (!ownedObject.DontDestroyWithOwner && (ownedObject.Observers.Count == 0 || (ownedObject.Observers.Count == 1 && ownedObject.Observers.Contains(clientId))))
if (!ownedObject.DontDestroyWithOwner)
{
if (NetworkManager.PrefabHandler.ContainsHandler(ownedObject.GlobalObjectIdHash))
{
Expand Down Expand Up @@ -1244,7 +1243,7 @@ internal void OnClientDisconnectFromServer(ulong clientId)
}

// Skip destroy with owner objects as they will be processed by the outer loop
if (!childObject.DontDestroyWithOwner && (childObject.Observers.Count == 0 || (childObject.Observers.Count == 1 && childObject.Observers.Contains(clientId))))
if (!childObject.DontDestroyWithOwner)
{
continue;
}
Expand Down
Loading