- Home /
Question by
DinoMax0112 · Oct 19, 2020 at 09:25 PM ·
unity 2dmultiplayer-networkingmirror
Teams in a Multiplayer Game using Mirror
Hello, I am new to making games, this is currently my second and I would like it to be multiplayer based. I would like two teams with one player on one and the other players on the other. I am using Mirror as a multiplayer framework, and I need the teams determined on join, I would like it to switch every game. I cannot choose teams in the scene switch because the one team has a 30-second headstart. Thanks in advance, Mark
The code I am looking to edit is
/// The default prefab to be used to create player objects on the server.
/// <para>Player objects are created in the default handler for AddPlayer() on the server. Implementing OnServerAddPlayer overrides this behaviour.</para>
/// </summary>
[Header("Player Object")]
[FormerlySerializedAs("m_PlayerPrefab")]
[Tooltip("Prefab of the player object. Prefab must have a Network Identity component. May be an empty game object or a full avatar.")]
public GameObject playerPrefab;
/// <summary>
/// A flag to control whether or not player objects are automatically created on connect, and on scene change.
/// </summary>
[FormerlySerializedAs("m_AutoCreatePlayer")]
[Tooltip("Should Mirror automatically spawn the player after scene change?")]
public bool autoCreatePlayer = true;
/// <summary>
/// The current method of spawning players used by the NetworkManager.
/// </summary>
[FormerlySerializedAs("m_PlayerSpawnMethod")]
[Tooltip("Round Robin or Random order of Start Position selection")]
public PlayerSpawnMethod playerSpawnMethod;
Comment