Multiplayer Identity Object Root Problem

Hi!
I had a problem with a multiplayer game I’m making, the console has a warning that says, "
The prefab ‘Player’ has multiple NetworkIdentity components. There can only be one NetworkIdentity on a prefab, and it must be on the root object.
UnityEngine.Networking.NetworkManagerHUD:OnGUI()"
Im not sure what a root object is and I don’t know what to do because it is preventing me from making the multiplayer work.
Thanks!

1 Like

Each GameObject (including children) can have only one NetworkIdentity component. So probably children of your GameObject have NetworkiIdentity too.

That’s why I can’t use most of Unity network components, because they all require NetworkIdentity component. For example NetworkAnimator requires NetworkIdentity AND Animator, so I can’t have Animator as child if I want to use NetworkAnimator.

As far as I know best way to use networking is to have custom class for every network object. For example if you have your main player class GamePlayer: create NetworkGamePlayer component which controls all network code for that object.