How to replicate physics simulated child components properly?

For example, let’s say I have a gate consisting of two static mesh components and two physics constraint components (hinges) which allow me to physically open the gate. Nothing fancy here. Now let’s say I wanted to add multiplayer. I obviously need to replicate the rotations of the two doors since neither is the root component of the gate so I can’t use the in-built static-mesh component replication (or can I?).

Now before I move on and add custom replication code to every blueprint in the game that has more than 0 child components, I wanted to ask if someone knows a better way to do this?

Here is what I’ve already tried out:

  • Setting a static mesh component as the root component. Using this method, the movement of the root component seems to get replicated correctly, child components however still won’t replicate their movement.

  • Manually setting IsReplicated(true) inside the child component. While this kinda works, it seems extremely buggy and i’m not sure if this is even the intended use case (strange behaviours include: randomly disappearing objects and jittering components when the actor’s world location and rotation is not equal to zero).

  • Using child actor components (physics constraints don’t like this) and / or composing everything inside the editor (effectively rendering blueprints as data type only). It would probably work but… I really don’t want to do this for obvious reasons.

So, any ideas what I should do in this situation? Should I just bite the bullet and replicate everything myself? Have I overlooked something?

Any answer would help, really.

Hello, I’m in the same situation, have you found a solution?

You don’t want to replicate this. It’ll choke your bandwidth and it’ll never sync on other clients.

Just let the simulated proxy push through it normally. If you replicate then the gate/door etc will move before the sim proxy pawn is close enough to it.

At most all you ever want to replicate is a state. Open, closed etc. (Rep_Notify)