Skip to content

Commit 728eb24

Browse files
Merge develop-2.0.0 into fix/destroy-in-scene-placed-objects
2 parents 3632713 + c8fb89e commit 728eb24

File tree

4 files changed

+273
-40
lines changed

4 files changed

+273
-40
lines changed

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ Additional documentation and release notes are available at [Multiplayer Documen
2121
### Changed
2222

2323

24+
## [2.4.3] - 2025-06-25
25+
26+
### Fixed
27+
28+
- Fixed issue where spawned objects with `NetworkObject.DontDestroyWithOwner` set to `false` would not be destroyed when using a client-server network topology. (#3522)
29+
30+
2431
## [2.4.2] - 2025-06-13
2532

2633
### Fixed

com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,7 @@ internal void OnClientDisconnectFromServer(ulong clientId)
11571157
if (ownedObject)
11581158
{
11591159
// If destroying with owner, then always despawn and destroy (or defer destroying to prefab handler)
1160-
// Handle an object with no observers other than the current disconnecting client as destroying with owner
1161-
if (!ownedObject.DontDestroyWithOwner && (ownedObject.Observers.Count == 0 || (ownedObject.Observers.Count == 1 && ownedObject.Observers.Contains(clientId))))
1160+
if (!ownedObject.DontDestroyWithOwner)
11621161
{
11631162
if (ownedObject.IsSpawned)
11641163
{
@@ -1219,7 +1218,7 @@ internal void OnClientDisconnectFromServer(ulong clientId)
12191218
}
12201219

12211220
// Skip destroy with owner objects as they will be processed by the outer loop
1222-
if (!childObject.DontDestroyWithOwner && (childObject.Observers.Count == 0 || (childObject.Observers.Count == 1 && childObject.Observers.Contains(clientId))))
1221+
if (!childObject.DontDestroyWithOwner)
12231222
{
12241223
continue;
12251224
}

0 commit comments

Comments
 (0)