Search Issue Tracker
Fixed
Fixed in 2.2.0
Votes
0
Found in [Package]
2.0.0
Issue ID
MTTB-624
Regression
Yes
Netcode for GameObjects 2.0 - Client network objects not syncing after scene loading
When loading a scene using NetworkManager.SceneManager, in scene NetworkObjects in the newly loaded scene are not synced for clients that were previous already connected. Clients that join after the scene has loaded are correctly synced
Steps to reproduce:
- Server {{S}} is running and has one connected client {{{}A{}}}. They are both in a starting scene {{{}Main{}}}.
- {{S}} calls {{NetworkSceneManager.LoadScene}} with {{LoadSceneMode.Additive}} loading scene {{{}Game{}}}. Scene {{Game}} contans an in-scene {{NetworkObject}} with a {{{}NetworkBehaviour{}}}-derived component {{{}o{}}}.
- After the scene transition, a new client {{B}} connects.
* {{B}} was previously in scene {{Main}} before connecting, and on connecting it correctly loads {{Game}} additively to bring it into the same state as {{S}} and {{{}A{}}}.
- {}Here's the bug{}: {{o.OnNetworkSpawn}} is not called on client {{{}A{}}}, the preexisting client who was brought into the scene along with the server. It is* called on the server itself {{S}} as well as on the late-joining client {{{}B{}}}.
* Updates to NetworkVariables updates on {{o}} the happen on the server {{S}} are correctly handed by the late-joining client {{B}} but cause errors on client {{{}A{}}}.
Actual results:
Client A sees:
{{A}} sees this:
{code:java}
[Netcode] [Deferred OnSpawn] Messages were received for a trigger of type NetworkVariableDeltaMessage associated with id (1), but the NetworkObject was not received within the timeout period 10 second(s). UnityEngine.Debug:LogWarning (object) Unity.Netcode.NetworkLog:LogWarning (string) (at ./Library/PackageCache/com.unity.netcode.gameobjects/Runtime/Logging/NetworkLog.cs:28) Unity.Netcode.DeferredMessageManager:PurgeTrigger (Unity.Netcode.IDeferredNetworkMessageManager/TriggerType,ulong,Unity.Netcode.DeferredMessageManager/TriggerInfo) (at ./Library/PackageCache/com.unity.netcode.gameobjects/Runtime/Messaging/DeferredMessageManager.cs:117) Unity.Netcode.DeferredMessageManager:CleanupStaleTriggers () (at ./Library/PackageCache/com.unity.netcode.gameobjects/Runtime/Messaging/DeferredMessageManager.cs:84) Unity.Netcode.NetworkManager:NetworkUpdate (Unity.Netcode.NetworkUpdateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs:374) Unity.Netcode.NetworkUpdateLoop:RunNetworkUpdateStage (Unity.Netcode.NetworkUpdateStage) (at ./Library/PackageCache/com.unity.netcode.gameobjects/Runtime/Core/NetworkUpdateLoop.cs:191) Unity.Netcode.NetworkUpdateLoop/NetworkPostLateUpdate/<>c:<CreateLoopSystem>b__0_0 () (at ./Library/PackageCache/com.unity.netcode.gameobjects/Runtime/Core/NetworkUpdateLoop.cs:286){code}
Filling out my comment {}"the inspector for it looks different"{}... On the bad client {{A}} (the client that was already joined), the inspector for the NetworkObject looks {}the same in play mode as it does in edit mode{}, with fields {{{}Always Replicate As Root{}}}, {{{}Synchronize Transform{}}}, etc. etc. etc.On both the server and the good client {{{}B{}}}, the NetworkObject inspector in play mode looks as you would expect, with {{{}GlobaObjectIdHash{}}}, {{{}NetworkObjectId{}}}, {{{}OwnerClientId{}}}, etc. etc. etc. {{IsOwner}} is true on the server and not on the client... exactly as you would expect.
... and breaking in {{{}NetworkObjectEditor.OnInspectorGUI{}}}, on the bad client, {{m_NetworkObject.IsSpawned}} is false.
Expected results:
when starting NetworkManager as server only, connecting one or more clients, and then loading a scene and the in-scene placed NetworkObjects do not get synchronized with the clients (but once the scene is loaded late joining clients do get synchronized).
Reproducible with versions:
NGO version 2.0.0
Editor: Unity 6000.0.26
OS: Mac
Not reproducible with versions:
Can’t test with versions:
Tested on (OS):
Notes:*
Comments (1)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
ANLevant
Jan 07, 2025 01:39
I encountered this issue in 6 after migrating from 2022.3