Cinemachine camera not working in Photon multiplayer system in Unity

I am fairly new to the whole multiplayer game mechanics, but I made a simple car controller and added cinemachine camera as a child to the car and then made it into a prefab, and I instantiate the car prefab in the game…..but every time I do that, the camera shifts to the other car…..

I’ve added all the important stuff like photon view and transform. I’ve also changed the script to check ‘if.mine’,

but still the camera shifts to the other second player while I control the first….

Can someone please help me to find a solution……

Loading Data From Lobby Scene to Gameplay Scene with Photon Network

As the title suggests, I am currently stuck trying to program a way to load some game mode preferences (ie. what type of game mode/players on each team/ etc…) from a player lobby scene to the actual gameplay scene.

Currently, I have taken the approach of creating a DontDestroyOnLoad prefab that successfully passes the preferences over; however, when mixed with the Photon Networking API, this becomes very annoying as the Prefab becomes unsynced, resulting in players connecting into the game not spawning into there correct positions and teams reading empty, etc…

Is there a more proper and reliable way to approach transferring player game mode data from the lobby scene to the gameplay scene? I’ve heard that PlayerPrefs could work but am unsure whether or not they should be used when networking is involved.

Photon Realtime, StripKeysWithNullValues cause heavy GC Alloc

In our current project, we use Photon room properties to sync entities. and i noticed some heavy GC Allocs while deep profiling the game and it always ends down to this method.

enter image description here

Have anyone faced this issue before ? or attempted to fix it ? here is the source code of that method.

/// <summary>         /// This removes all key-value pairs that have a null-reference as value.         /// Photon properties are removed by setting their value to null.         /// Changes the original passed IDictionary!         /// </summary>         /// <param name="original">The IDictionary to strip of keys with null-values.</param>         public static void StripKeysWithNullValues(this IDictionary original)         {             object[] keys = new object[original.Count];             original.Keys.CopyTo(keys, 0);              for (int index = 0; index < keys.Length; index++)             {                 var key = keys[index];                 if (original[key] == null)                 {                     original.Remove(key);                 }             }         } 

problema al instanciar con photon

Estoy utilizando PUN 2 en unity para un juego online y me ha surgido un problema a la hora de instanciar el objeto ya que solo me instancia uno cuando debería instanciar uno por cada jugador que se conecto por aqui os dejo el codigo:

public class PhotonConnection : MonoBehaviourPunCallbacks {     public GameObject jugador;     public Button ConnectButton;     public Button JoinRandomButton;     public Text Log;     public Text PlayerCount;     public int playersCount = 0;     public byte maxPlayersPerRoom = 4;     public byte minPlayersPerRoom = 2;     private bool carga = false;     public string nombrePrefabEnResources = "police1";      public void Connect()     {         //Intentamos conectarnos a Photon Cloud si no estamos ya conectados         if (!PhotonNetwork.IsConnected)         {             PhotonNetwork.GameVersion = "1";             if (PhotonNetwork.ConnectUsingSettings())             {                 Log.text += "\nConnected to server";             }             else             {                 Log.text += "\nFaiiling Connecting to Server";             }         }         //Si estamos conectados nos unimos a una habitación aleatoria     }      //Se ejecuta cuando se conecta con el servidor     public override void OnConnectedToMaster()     {          //Nos unimos a una partida         ConnectButton.interactable = false;         JoinRandomButton.interactable = true;     }     public void JoinRandom()     {         if (!PhotonNetwork.JoinRandomRoom())         {             Log.text += "\nFail Joinin room";         }      }      //Se ejecuta cuando falla el proceso de unirse a una partida aleatoria (normalmente es porque no existe ninguna)     public override void OnJoinRandomFailed(short returnCode, string message)     {         //Como suele ejecutarse OnJoinRandomFailed cuando no existe ninguna partida, creamos una nueva         Log.text += "\nNo Rooms to Join, creating one...";         if (PhotonNetwork.CreateRoom(null, new Photon.Realtime.RoomOptions() { MaxPlayers = maxPlayersPerRoom }))         {             Log.text += "\nRoom Created";         }         else         {             Log.text += "\nFail Creating Room";         }     }     private void FixedUpdate()     {         if (PhotonNetwork.CurrentRoom != null)         {             playersCount = PhotonNetwork.CurrentRoom.PlayerCount;             PlayerCount.text = playersCount + "/" + maxPlayersPerRoom;             if (!carga && playersCount >= minPlayersPerRoom)             {                 Debug.Log("entre");                 CargarMapa();             }         }     }     //Se ejecuta cuando nos unimos a la partida     public override void OnJoinedRoom()     {         Log.text += "\nJoined";         JoinRandomButton.interactable = false;         Debug.Log("q entrooo");     }     private void CargarMapa()     {         carga = true;         //aqui cargue la escena         PhotonNetwork.LoadLevel("SimpleTown_DemoScene");         //aqui intancio         PhotonNetwork.Instantiate(nombrePrefabEnResources, new Vector3(25f * PhotonNetwork.PlayerList.Length, 5f, 0f), Quaternion.identity, 0);         Debug.Log("cargue");         //Habilitamos todos sus componentes         /*foreach (MonoBehaviour move in car.GetComponents<MonoBehaviour>())         {             if (!move.enabled)                 move.enabled = true;         }*/       }   } 

llevo una semana y media intentando buscar la solución a este problema pero la verdad que no la encuentro agradecería mucho vuestra ayuda gracias de antemano, en la función Cargarmapa() carga una escena ya que posteriormente había un menú con el cual apartir de el nos hemos conectado al servidor

Problema al crear el jugador en Unity con Photon

Estoy usando PUN 2, llevo usandole en este proyecto alrededor de un año y ahora lo que me pasa es que al jugador al entrar en la escena instancia su GameObject, y lo hace bien en su partida pero en el Master y en los demás jugadores, me instancia 2 o directamente no me instancia. También he visto que este bug pasa con mas frecuencia cuando el Master es un dispositivo móvil a un pc. Mi código de instanciar a un jugador es muy simple y ya digo que me ha funcionado durante un año.El único cambio que hubo fue que desde el lobby puedes elegir la escena y antes se hacia automáticamente.Adjunto las lineas de codigo para instanciar al jugado.

private bool instantiatePlayer=false;  private void Awake() {     if (!instantiatePlayer)     {         CreatePlajer();         instantiatePlayer = true;     } }