Why does NetworkTransformChild have to be attached on the root object?

When I was using UNET I had a question. There’re no such constraints for NetworkTransform that requires the GameObject should be a root in the hierarchy. But as long as I attached a NetworkTransformChild, I could no longer put this GameObject under others.

This doesn’t look reasonable to me, and it actually has already affected the development of my project. So I wonder why. Is it possible to remove this strange constraint?

All the networking starts at NetworkIdentity - so all NetworkBehaviours have to be a component next to it (aka not on children)

Right. But there’s not such requirement that GameObjects with NetworkIdentity should be root GameObjects. So why does NetworkTransformChild have to be on root GameObjects?

My understanding is the NetworkIdentity in fact does need to be on the root GameObject.

https://docs.unity3d.com/ScriptReference/Networking.NetworkIdentity.html

And the NetworkTransformChild needs to be on the same GameObject as the NetworkIdentity, so that’s why it also has to be on the root GameObject.

Oh I see. Wasn’t aware of that. Thanks!

I was putting GameObjects with NetworkIdentity under other objects when they are spawned, and it seemed fine.

Hmm this constraint makes it harder to group GameObjects in the hierarchy.