- Home /
Question by
Siddarthpro · Nov 06, 2021 at 01:13 PM ·
networking
The console prints starting connection but doesn't print anything else
public class roomMan : MonoBehaviourPunCallbacks { public string roomName = "room01"; public Transform spawnPoint; public GameObject playerPref; public bool isConnected = false;
void Start()
{
PhotonNetwork.ConnectUsingSettings("0.0.1");
Debug.Log("Starting Connection!");
}
public override void OnJoinedLobby()
{
Debug.Log("Starting Server!");
PhotonNetwork.JoinOrCreateRoom(roomName, null, null);
}
public override void OnJoinedRoom()
{
isConnected = true;
spawnPlayer();
}
public void spawnPlayer()
{
GameObject pl = PhotonNetwork.Instantiate(playerPref.name, spawnPoint.position, spawnPoint.rotation, 0) as GameObject;
pl.GetComponent<RigidBodyFpsWalker>().enabled = true;
pl.GetComponent<RigidBodyFpsWalker>().fpsCam.SetActive(true);
}
}
Comment
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Communication in a network 1 Answer
PUN vs uMMO 1 Answer
Check if a player has Network View 0 Answers
Raycasts in Multiplayer Network 0 Answers