I use Photon to make a multiplayer game and I can’t imagine making a random spawn. I would like to be able to place empty ones and randomly choose an empty one where the player will spawn. i use this script:
using Photon.Pun;
using Photon.Realtime;
using UnityEngine;
public class PhotonManager : MonoBehaviourPunCallbacks
{
public Transform spawn;
void Start()
{
PhotonNetwork.ConnectUsingSettings();
}
public override void OnConnectedToMaster()
{
PhotonNetwork.JoinLobby();
}
public override void OnJoinedLobby()
{
PhotonNetwork.JoinOrCreateRoom("Room1", new RoomOptions { MaxPlayers = 4 }, TypedLobby.Default);
}
public override void OnJoinedRoom()
{
Debug.Log("Joined Room");
PhotonNetwork.Instantiate("Player", spawn.position, spawn.rotation);
}
}