Skip to content

Commit c8fb89e

Browse files
NoelStephensUnityunity-renovate[bot]EmandM
authored
chore: merge v2.4.3 back into develop-2.0.0 (#3523)
Chore to merge the hot-fix patch v2.4.3 back into the develop-2.0.0 branch. ## Changelog NA ## Testing and Documentation - No tests have been added. - No documentation changes or additions were necessary. <!-- Uncomment and mark items off with a * if this PR deprecates any API: ### Deprecated API - [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter yyyy-mm-dd)` entry. - [ ] An [api updater] was added. - [ ] Deprecation of the API is explained in the CHANGELOG. - [ ] The users can understand why this API was removed and what they should use instead. --> ## Backport This is a v2.x specific PR. <!-- If this is a backport: - Add the following to the PR title: "\[Backport\] ..." . - Link to the original PR. If this needs a backport - state this here If a backport is not needed please provide the reason why. If the "Backports" section is not present it will lead to a CI test failure. --> --------- Co-authored-by: unity-renovate[bot] <120015202+unity-renovate[bot]@users.noreply.github.com> Co-authored-by: Emma <emma.mcmillan@unity3d.com>
1 parent 3a64ab0 commit c8fb89e

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
@@ -20,6 +20,13 @@ Additional documentation and release notes are available at [Multiplayer Documen
2020
### Changed
2121

2222

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

2532
### Fixed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,8 +1177,7 @@ internal void OnClientDisconnectFromServer(ulong clientId)
11771177
if (ownedObject)
11781178
{
11791179
// If destroying with owner, then always despawn and destroy (or defer destroying to prefab handler)
1180-
// Handle an object with no observers other than the current disconnecting client as destroying with owner
1181-
if (!ownedObject.DontDestroyWithOwner && (ownedObject.Observers.Count == 0 || (ownedObject.Observers.Count == 1 && ownedObject.Observers.Contains(clientId))))
1180+
if (!ownedObject.DontDestroyWithOwner)
11821181
{
11831182
if (NetworkManager.PrefabHandler.ContainsHandler(ownedObject.GlobalObjectIdHash))
11841183
{
@@ -1244,7 +1243,7 @@ internal void OnClientDisconnectFromServer(ulong clientId)
12441243
}
12451244

12461245
// Skip destroy with owner objects as they will be processed by the outer loop
1247-
if (!childObject.DontDestroyWithOwner && (childObject.Observers.Count == 0 || (childObject.Observers.Count == 1 && childObject.Observers.Contains(clientId))))
1246+
if (!childObject.DontDestroyWithOwner)
12481247
{
12491248
continue;
12501249
}

0 commit comments

Comments
 (0)