Hello, sorry if I’m writing to wrong section, but anyway I can’t instantiate player on network.
This is my script to connect:
using UnityEngine;
using System.Collections;
public class NetworkManager : Photon.MonoBehaviour {
public Transform respawn;
private const string _VERSION = "1.0";
void Start() {
PhotonNetwork.autoJoinLobby = false;
PhotonNetwork.ConnectUsingSettings(_VERSION);
}
public virtual void OnConnectedToMaster() {
PhotonNetwork.JoinRandomRoom();
}
public void OnPhotonRandomJoinFailed() {
PhotonNetwork.CreateRoom(null, new RoomOptions() { maxPlayers = 4 }, null);
}
public void OnJoinedRoom() {
Debug.Log(Resources.Load("Player"));
PhotonNetwork.Instantiate("Player", respawn.position, respawn.rotation, 0);
}
}
Using Debug.Log(Resources.Load("Player"));
placed inside of OnJoinedRoom() I’ve found out that it locates Player. But it won’t instantiate. Instead, it instantiates default Unity 3rd person controller. Any idea why?