hey!
i got a prefab with a camera with quite a few scripts in it. anyway when i start the network game i get wrong camera since the instances have the same names, because i only rename the controller depending on if its networkViewed.
i basicly want to rename the other cameras, when its remote (not controlled by me). without screwing everything up… so cameras dont get mixed up.
but the camera is a child of of the controller(dont ask me why), and i have a hard time to rename it.
i should rename it in:
if (networkView.isMine){
}
else{
here <-- ?
}
any suggestions?
I had the same problem in my game.
What I did was to not have any cameras in the network instantiated objects. Just use one camera in the whole scene. When “your own” object is instanciated, set the ONE camera to follow that object.
i managed to solve this, and still keep my camera in the prefab. the reason why i do it is because it feels to complex to re-target all my scripts on the camera.
i first deactivated the main cam (gui cam) on level startup. then:
var playerCam : GameObject; (the camera in the prefab)
playerCam.GetComponent(“Camera”).active = false;
if this is done in (!networkView.isMine)
then the instance for the remote players camera is deactivated. not my own instance.