diff --git a/Mirror/Runtime/NetworkManager.cs b/Mirror/Runtime/NetworkManager.cs index d7a5d2749..6cfdf694f 100644 --- a/Mirror/Runtime/NetworkManager.cs +++ b/Mirror/Runtime/NetworkManager.cs @@ -648,16 +648,10 @@ void OnServerAddPlayerInternal(NetworkConnection conn) return; } - GameObject player; Transform startPos = GetStartPosition(); - if (startPos != null) - { - player = Instantiate(playerPrefab, startPos.position, startPos.rotation); - } - else - { - player = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity); - } + GameObject player = startPos != null + ? Instantiate(playerPrefab, startPos.position, startPos.rotation) + : Instantiate(playerPrefab, Vector3.zero, Quaternion.identity); NetworkServer.AddPlayerForConnection(conn, player); }