Question by
RainKiller27 · Jan 22, 2016 at 01:12 PM ·
networkphoton
PUN Camera and player movement over a network
Hello i'm trying to activate my first person player camera Character controller with the script i'm writing I keep getting errors and I can't seem to fix it with out of date PUN documentation here is the code would appreciate it if anyone can help me
**using UnityEngine; using System.Collections;
public class NetworkCore : MonoBehaviour {
public string roomName = "default";
public string playerPrefabName = "player";
public Transform spawnPoint;
void Start () {
PhotonNetwork.ConnectUsingSettings ("v1.0");
}
void Update () {
}
void OnGUI() {
GUILayout.Label (PhotonNetwork.connectionStateDetailed.ToString ());
}
void OnJoinedLobby() {
RoomOptions roomOptions = new RoomOptions () { isVisible = false, maxPlayers = 4 };
PhotonNetwork.JoinOrCreateRoom(roomName, roomOptions, TypedLobby.Default);
}
void OnJoinedRoom() {
Spawn ();
}
void Spawn() {
GameObject player = (GameObject)PhotonNetwork.Instantiate (playerPrefabName, spawnPoint.position, spawnPoint.rotation, 0);
CharacterControl controller = player.GetComponent<CharacterControl>();
controller.enabled = true;
CharacterCamera camera = player.GetComponent<CharacterCamera>();
camera.enabled = true;
}
}**
Comment
Your answer
Follow this Question
Related Questions
Network lobby manager tutorial +PUN? 0 Answers
Photon - Enable MouseLook Script from First Person Controller? 1 Answer
Photon - Possible to sync CrossFixedInTime Animator State? 0 Answers
i can't see other player with photon cloud server,I Can't see each other player in photon cloud 2 Answers
Pull Playfab users list 0 Answers