diff --git a/Assets/Mirror/Runtime/NetworkServer.cs b/Assets/Mirror/Runtime/NetworkServer.cs index ce8cba72e..c3a601563 100644 --- a/Assets/Mirror/Runtime/NetworkServer.cs +++ b/Assets/Mirror/Runtime/NetworkServer.cs @@ -615,8 +615,8 @@ static void FinishPlayerForConnection(NetworkConnection conn, NetworkIdentity id internal static bool InternalReplacePlayerForConnection(NetworkConnection conn, GameObject playerGameObject) { - NetworkIdentity playerNetworkIdentity; - if (!GetNetworkIdentity(playerGameObject, out playerNetworkIdentity)) + NetworkIdentity playerNetworkIdentity = playerGameObject.GetComponent(); + if (playerNetworkIdentity == null) { Debug.LogError("ReplacePlayer: playerGameObject has no NetworkIdentity. Please add a NetworkIdentity to " + playerGameObject); return false;