Posted on

Multiple Camera in your Unity Photon Multiplayer Games ft Eletrax

If you are ever building a multiplayer first-person shooter in Unity using the Photon plugin you might run into this problem. The problem we discuss is when you have more than one camera in your scene because there is a camera attached to each player object. This will cause the cameras to stack up on top of each other and the top or primary camera might not be your first-person camera which means while you are controlling your local player object you might not be viewing your player through their camera.

To fix this problem you need to disable the camera of each player object that is not your local player object. You will need to use the photon view component to check to see if the is mine variable is false. If it is then you will need to use a camera variable and set the enable variable to false. This will make it so you will only have one camera active in your multiplayer scene and that will be your local first-person camera.