- Home /
Disabling child camera over network
I have a script which network instantiates two first person controllers. I've disabled the controls with networkView.IsMine
, but when I play the game, the camera is not disabled and you control the wrong controller. How would I disable the camera that is a child object of the first person controller?
Answer by moghes · May 23, 2013 at 12:16 AM
you must have a script attached to your prefab(FPS or whatever), have a public var mycam:Camera
(javascript example) and drag your child camera to your public var, now whenever you check networkView.IsMine , simple set myCam.active = true;
or myCam.active=false;
I have done this just today :) Are you using Network.Instantiate? or you have attached networkView component and working with RPCs?
I'm using Network.Instantiate to clone the prefab for every player who joins. I also have a attached networkView component, as it doesn't seem to render over the network without it. I might be doing it a different way than is correct.