You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
when manually loading scene the order of functions causes clients to be unable to spawn scene objects.
NetworkServer.SpawnObjects() only checks IsReady, so will send spawn messages to all ready connections NetworkServer.SetClientReady() checks if there is player object before spawning.
if SpawnObjects is called on server after client is ready, but before player objects are added then Client wont find scene objects.
This makes scene loading difficult in host mode because SpawnObjects must be called on host before NetworkClient.Ready is called
How can we reproduce the issue, step by step:
Load new scene
Call NetworkClient.Ready() on clients
when all players are ready call NetworkServer.SpawnObjects() on server
See that server sends Spawn message NetworkConnections that have Identity == null
See errors on clients Spawn scene object not found for
Expected behavior
Server should not add NetworkConnections that as observer or send Spawn messages when conn.Identity is null
Version
Mirror version: v78.3.0
Suggested fix NetworkServer.AddAllReadyServerConnectionsToObservers should also check conn.identity != null before adding Observers
The text was updated successfully, but these errors were encountered:
Describe the bug
when manually loading scene the order of functions causes clients to be unable to spawn scene objects.
NetworkServer.SpawnObjects()
only checks IsReady, so will send spawn messages to all ready connectionsNetworkServer.SetClientReady()
checks if there is player object before spawning.if
SpawnObjects
is called on server after client is ready, but before player objects are added then Client wont find scene objects.This makes scene loading difficult in host mode because
SpawnObjects
must be called on host beforeNetworkClient.Ready
is calledHow can we reproduce the issue, step by step:
NetworkServer.SpawnObjects()
on serverIdentity == null
Spawn scene object not found for
Expected behavior
conn.Identity
is nullVersion
Mirror version: v78.3.0
Suggested fix
NetworkServer.AddAllReadyServerConnectionsToObservers
should also checkconn.identity != null
before adding ObserversThe text was updated successfully, but these errors were encountered: