Camera rotation in PUN 2

Hi!

I'm trying to make a network application (2D) through PUN 2 (Photon unity network 2), namely the Pong game, I want each player (so far only two, since there can be only 2 in one room), their own prefab on their screen moved from below.
Since we have a ball that is on the playing field, I decided to implement this on the second client by simply rotating his camera.
I connect to the server in the standard ways, create a room, connect to it as the second player by calling:
PhotonNetwork.LoadLevel("Game");
After going to the scene, I actually make a check:
if ( !PhotonNetwork.IsMasterClient ) {
Camera.main.transform.Rotate(new Vector3(0,0,180f);
}
PhotonNetwork.Instantiate("Player", Vector3.zero, Quaternion.identity);
I go into the camera, I see that it is upside down, BUT the player's prefab is still on top!
I found out in the editor that when you rotate the camera, the spawned prefabs rotate with it, why is this happening and how to solve it?
At first, I made prefabs through Sprite Renderer, I thought that due to the fact that Sprite is essentially drawn on the UI, although it was not created in the canvas (but due to the fact that it is drawn on the UI, I can be wrong), this may occur, then I replaced with the usual Mesh Renderer, but that did not help either.
If I create a cube in debug, and start to rotate the camera, the cube does not rotate, but the prefabs rotate (they are not child objects of the camera either, I did it). Such a situation that the prefabs do not change their world coordinates when the camera is rotated, but move together with the camera!
The prefab has such unusual components as: Photon View, in which there is one Observed Component, my Controller for the prefab, in which I only synchronize transform.position, to actually synchronize two clients.

Thanks!

Comments