Made a small change to PlayerSpawner in how the spawn position is calculated.

This commit is contained in:
Karrar
2025-03-01 01:44:32 +03:00
parent 79fcfc17ff
commit c5ebb22afd
8 changed files with 3 additions and 3 deletions

View File

@@ -12,7 +12,7 @@ namespace Netick.Samples.FPS
// This is called on the server when a player has connected.
public override void OnPlayerConnected(NetworkSandbox sandbox, NetworkPlayer networkPlayer)
{
var spawnPos = SpawnPos.position + Vector3.left * (1 + sandbox.ConnectedPlayers.Count);
var spawnPos = SpawnPos.position + (Vector3.left * sandbox.ConnectedPlayers.Count);
var player = sandbox.NetworkInstantiate(PlayerPrefab, spawnPos, Quaternion.identity, networkPlayer).GetComponent<FPSController>();
networkPlayer.PlayerObject = player.gameObject;
}