Multiple Network Identities on one prefab

I’m getting this message:
“Prefab ‘Platform’ has several NetworkIdentity components attached to itself or its children, this is not supported.”

Even though I’m not spawning in this prefab (it’s already in the scene). I even get this message if I detach the prefab from the instantiated object. (This is one prefab with lots of pieces each with it’s own Network Identity). Do I basically need to just bring in each piece separately?

I’m using Unity 5.6.1f1.

Unet doesn’t like nesting network identity scripts.

You should try to come up with a way of structuring your setup so that there’s only one network identity on the entire object.

Just use 1 network identity component on the root of the prefab.Btw, what are you trying to make? Maybe I can help you with finding a solution.

-Speedex

I have the same problem. In my case, I have a prefab for an apple tree. The apples are items that can be picked up, and the tree has health and can be cut down. Therefore I’m thinking all of the objects need to have an identity, as they are functioning individually.

NetworkIdentity components are only supported on the root gameobject, not child objects.

No, just the tree, but since it has Health, then you already have a NetworkBehavior on it too. Just extend that with an array of game objects and add your apples to that array. When the apple is picked, remove it from the array and sync the array to clients.