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.