mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
MirrorTest: fix CreateNetworkedAndSpawnPlayer not properly spawning because the GO wasn't considered for spawning because it wasn't inactive
This commit is contained in:
parent
badde10c1d
commit
9512b8f0e6
@ -415,6 +415,11 @@ protected void CreateNetworkedAndSpawnPlayer(
|
||||
clientIdentity.sceneId = serverIdentity.sceneId = (ulong)serverGO.GetHashCode();
|
||||
NetworkClient.spawnableObjects[clientIdentity.sceneId] = clientIdentity;
|
||||
|
||||
// IMPORTANT: OnSpawn finds 'sceneId' in .spawnableObjects.
|
||||
// only those who are ConsiderForSpawn() are in there.
|
||||
// for scene objects to be considered, they need to be disabled.
|
||||
clientGO.SetActive(false);
|
||||
|
||||
// add as player & process spawn message on client.
|
||||
NetworkServer.AddPlayerForConnection(ownerConnection, serverGO);
|
||||
ProcessMessages();
|
||||
|
Loading…
Reference in New Issue
Block a user