- Home /
Question by
marlonciriatico · Sep 12, 2019 at 06:35 PM ·
networkingmultiplayermultiplayer-networkingonline
UNet child objects: MonoBehavior or NetworkBehavior?
I read that each networked GameObject must have at most one NetworkIdentity, so the children of a GameObject with a NetworkIdentity component shouldn't have that component too.
What if I have a GameObject (with a NetworkIdentity component) with plenty of children and most of them have scripts (MonoBehaviour) attached to them? It seemed to me that I should convert all MonoBehaviour to NetworkBehaviour. But if I can't have a NetworkIdentity attached to a child GameObject, how can it have a NetworkBehaviour attached to it?
Here's an example of my question:
PlayerNetwork is a GameObject with only Network Identiy and NetworkTransform.
PlayerContainer is a GameObject that don't have any Network code, it works fine in SinglePlayer.
container.png
(36.8 kB)
Comment