NetworkObjects spawned inside a scene are spawned before the scene is loaded on late-joining clients #3115
Labels
stat:awaiting response
Status - Awaiting response from author.
stat:awaiting triage
Status - Awaiting triage from the Netcode team.
type:bug
Bug Report
Description
NetworkObjects spawned inside a scene are spawned before the scene is loaded on late-joining clients using Distributed Authority.
Reproduce Steps
NetworkManager
session owner and loads a scene "Scene".NetworkBehaviour
script.OnInSceneObjectsSpawned
override and will spawn a "Player"NetworkObject
on it.SpawnWithOwnership(NetworkManager.Singleton.LocalClientId, destroyWithScene: true)
.NetworkBehaviour
with anOnNetworkPostSpawn
override and will register itself with the Level.Actual Outcome
A null reference exception as Client A's Player tries to register itself on the Level script before the Scene is even loaded.
Expected Outcome
That the logical flow of scene and object spawning is maintained.
When a late-joining client joins the game, they should first load the active scene, and then spawn NetworkObjects, not just randomly do both.
Environment
The text was updated successfully, but these errors were encountered: