[UNET] Can I have a NetworkBehaviour under the NetworkIdentity instead of next to it?

Hey guys,

I currently have a typical player GameObject, with lots of MonoBehaviours. Some of these come from a prefab, which is being spawned in that player hierarchy. I want some of these to be NetworkBehaviours, so they can use the [Command] or [ClientRpc] functionality. Is there any way to do this without having to resort to some intermediate interface next to the NetworkIdentity, or am I perhaps misunderstanding something?

Thanks in advance.

b u m p

anyone? :slight_smile:

Hi !
You have to add a NetworkIdentity. I don’t know if there is a plan to support network functionality in children.

But is having one NetworkIdentity’s per player object not a best practice? Or is the idea that you have multiple per player object?

Sure the list of networked game object will be larger. I don’t know how it is implemented in the HLAPI, if it is in a dictionary it should be not so critics (I guess).

For now, there is an issue because the player won’t have authority on the spawned game object.
But I read there is a new spawn function to have the authority on it (in a patched version but I don’t know which one).

It’s not so much that I’m worried about memory, but more worried about network overhead, by having multiple network identities on a single player GameObject. Anyone knows what Unity’s intended idea is behind this?