Problem with children objects and networking

Hello guys !

I’m currently working on a multiplayer game project, in which you will be able to drive some jeeps or buggys to kill other players. I wanted to directly work on a multiplayer version of the game, so I created a CarController script (in C#) to controll the car (speed, direction). But, I’m in front of a big problem :
I have an empty called car, with the car model and a camera, which have a network identity, without network transform, and I simply make this script only related to the local player by adding a condition at the beginning of the Update() function :

if (!isLocalPlayer) {
return;
}
//rest of the update function

But the problem is that my car have a turret, to shoot, and a camera behind the car, which is a MainCamera for the Localplayer. But the main problem is that those two objects are children of the car empty, which have the networkidentity. And if I make my scripts TurretController and CameraController “NetworkBehaviour”, it says that it cannot work because those objects are children of the car empty…

So all the players can turn all the cameras and all the turrets… That’s annoying :confused:

Does anyone could help me ? If you need any precision, please tell me !

Thanks :slight_smile:

You probably need one NetworkIdentity on your car, and then add a script to it that controls the car, the turrets, etc.

I will try it :slight_smile: