Implement player network spawning and position synchronization

This commit is contained in:
2024-08-25 17:43:19 +02:00
parent 6e037b4d06
commit b05cab8288
30 changed files with 689 additions and 26 deletions

View File

@@ -19,8 +19,9 @@ public class PlayerSpawner : MonoBehaviour
.ToArray();
}
public void Spawn(GameObject player)
public void Spawn(PlayerComponent player)
{
player.GetComponent<HVRTeleporter>().Teleport(spawns.First().position);
var spawn = spawns.First();
player.Teleport(spawn.position, spawn.eulerAngles);
}
}