Networking - Camera Swapping to Target Incorrect Player

I spawn a prefab that has an camera child and the player should just see through that camera. If there’s just one player on the network, he has the right cam, but when the second player joins, he changes his camera with the one from him. Each camera is a child of each player. I use a prefab, and the camera begins disabled. I attempt to enable it in the player script with the following code:

function Awake(){
	GetComponent(Camera).enabled = true;


However, I’m still getting this strange result. When I add a second player to the game, the first player’s camera gets moved to the second player, while the second player’s camera follows the first player, but the controls are correct. In short, the cameras swap places.

Should I change my camera setup, or is there a way to make this work? Thanks!

You need to check for if the camera is local!

function Awake() {
        camera.enabled = true;

If the camera script itself doesn’t have a network-view component, use the one from the player instead.

I’ve got the same situation: I’ve got a prefab vehicle (named HoverRig_Prefab) with a camera further down in the hierarchy. The top level node has the network-view component and I put your camera-enabling code also on the top node, but when I start the game, I get this error message:

MissingComponentException: There is no ‘Camera’ attached to the “HoverRig Prefab(Clone)” game object, but a script is trying to access it.
You probably need to add a Camera to the game object “HoverRig Prefab(Clone)”. Or your script needs to check if the component is attached before using it.

I’m not sure what you mean by using the network-view component from the player, but could that be the problem, or do I need to do something else?