Player prefab : sync child rigidbody

Hi everyone,

I started to implement the networking system in my project, but i don’t know how i can handle child rigidbodies. The NetworkTransform component only manages the parent object of the prefab (i added a NetworkTransform on both childs it doesn’t change anything, maybe the childs have to be spawned on the network too ?). Actually the 5.2 update adds a “NetworkTransformChild” component but only sync transform position and rotation, no physic.

Here is my prefab hierarchy :
-Parent Object : no component, just here to regroup the 2 childrens
–Body : contains a rigidbody with box collider, and the main script
–Feet : contains a rigidbody with box collider and a spring joint connected to the Body

Does anyone know how i can handle all my rigidbodies in order to have good sync of the entire object ? Or do i have to wait another Unity update, hoping they will do that ?

1 Like

First off I thought rigid body setups like you have are a no no?

Nope it’s the case if the parent and the child have rigidbodies, in my hierarchy the parent object doesn’t have anything, the two childrens move differently when the joint is disabled.

Just for information, i checked the doc again (http://docs.unity3d.com/Manual/UNetSpawning.html) and find something to keep moving : “NetworkBehaviour scripts must be on the same game object as the NetworkIdentity, not on child game objects”, so i put my script on the parent and removed NetworkIdentity on the Body. Now the two childrens work pretty well with the NetworkTransformChild component, so maybe i’ll try to sync the velocity by myself.

Did you ever find a solution for this problem? I find myself in the exact same situation. It’d be nice to use Unity’s networking functions to handle the syncing of the child rigidbodies, instead of writing custom code.

Actually i’m currently using the plugin “Forge Networking” available on the Asset Store, they manage this situation.
But you can use what i said : the NetworkTransformChild component, then write your own position lerp depending on current physic, maybe i will do that because physic sync is kinda mess :-/

Has changed anything through the years?