- Home /
Photon Networking not synchronizing
Hello,
I came across the photon networking plugin for unity and wanted to test it with an simple app. So I created 3x3 tile map with 9 planes and on mouse click it changes the color, set up a connection using the following code and using the 20 free user cloud server:
using UnityEngine;
using System.Collections;
public class NetworkManager : MonoBehaviour {
void Start () {
Connect ();
}
void Connect(){
PhotonNetwork.ConnectUsingSettings( "V0.1" );
}
void OnGUI () {
GUILayout.Label (PhotonNetwork.connectionStateDetailed.ToString ());
}
void OnJoinedLobby() {
Debug.Log ("OnJoinedLobby");
PhotonNetwork.JoinRandomRoom ();
}
void OnPhotonRandomJoinFailed() {
Debug.Log ("OnPhotonRandomJoinFailed");
PhotonNetwork.CreateRoom( null );
}
void OnJoinedRoom() {
Debug.Log ("OnJoinedRoom");
}
}
which shows when press play that it is connected and joined the room. Also I attached PhotonView to every single tile even on the camera to see on the other side any changes, but nothing happens. As they are not connected to each other, even though I start first the game from unity and after that the exe. I don't know what is wrong, could someone help me with this? Also do you think I have to add empty objects for player one and player two? But if I add players I am not sure how to switch the control from one to another..
Thanks!
This topic is not well suited for "Answers". It's not of general interest and there is no "true" answer either. Some pointers: You don't have to use empty objects. You should do the Tutorial for PUN a few times more. Code it. Experiment with what it does. Then solve your problem.