Hey guys! Quick little problem I can’t find out how to fix…
I posted a while ago on Photon forums but no one is on at this time of day. and Unity forums is much more active.
I am having a problem when multiple players join their cameras get switched, I will give an example with 2 players:
the first player joins, their camera is perfect and movement it perfect;
the second player joins, the first player’s camera switches to the first player’s and vice versa.
So here is my Network Manager;
using UnityEngine;
using System.Collections;
public class NetworkManager : MonoBehaviour {
private string VERSION = "V1.0";
public string roomName = "MR1";
public string playerPrefabName = "Player";
public Transform Spawn;
void Start () {
Debug.Log("Start");
PhotonNetwork.ConnectUsingSettings(VERSION);
}
void OnJoinedLobby() {
Debug.Log("Joined Lobby");
RoomOptions roomOptions = new RoomOptions() { isVisible = false, maxPlayers = 6 };
PhotonNetwork.JoinOrCreateRoom(roomName, roomOptions, TypedLobby.Default);
}
void OnJoinedRoom() {
Debug.Log("Joined Room");
GameObject myPlayer = PhotonNetwork.Instantiate(playerPrefabName, Spawn.transform.position, Spawn.transform.rotation, 0);
}
}
I would also like to implement a smooth camera follow script as I am just putting the player into an empty object with the camera which sort of makes it choppy