mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix(NetworkConnectionToClient): DestroyOwnedObjects use RemovePlayerForConnection for scene objects instead of UnSpawn
- Scene objects need to stay alive for everyone else by default - Users can choose to Unspawn for themselves.
This commit is contained in:
parent
49ad787d7c
commit
561e33ffea
@ -204,10 +204,9 @@ internal void DestroyOwnedObjects()
|
||||
{
|
||||
if (netIdentity != null)
|
||||
{
|
||||
// unspawn scene objects, destroy instantiated objects.
|
||||
// fixes: https://github.com/MirrorNetworking/Mirror/issues/3538
|
||||
// disown scene objects, destroy instantiated objects.
|
||||
if (netIdentity.sceneId != 0)
|
||||
NetworkServer.UnSpawn(netIdentity.gameObject);
|
||||
NetworkServer.RemovePlayerForConnection(this, RemovePlayerOptions.KeepActive);
|
||||
else
|
||||
NetworkServer.Destroy(netIdentity.gameObject);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user