Replicating a Runtime Mesh Components

I need some help, I have pawn that loads its meshes on Runtime and some meshes through ADD STATIC MESH COMPONENT Like in the 1. image, when I play my game, nothing gets replicated, the meshes created on runtime are not even visible, even though I set them to “Should Replicate”. I have an event that calls a series of functions to Load my visual meshes from a DataTable or a struct variable. Like in image 2. How can I replicate it so the other players can see my Car, wheels and everything


Skeletal & Static Mesh components do not replicate.


The best approach would be to use Repnotify struct and have the generated OnRep Function do the building. Server sets the Struct values.

So If I have a code that generates the visuals on runtime, Like Add Scene Component. I can promote it to a variable and replicate that variable? Maybe use a RepNotify and when it changes, What should I code there?

No, You call specific Events. Those events Execute the creation of components etc.

Repnotify is best. It will run for new/late joiners where as Multicasts/RPC’s are one off executions.

Here’s a very simple example.

In the Game mode class (only exists on the server) I’m setting a cosmetics struct on the character class just as it’s spawned by the GM.

In the character class I’m using the cosmetics repnotify function to actually build the character on each client. Set the Mesh, Materials, Material Parameters etc.

Changes to the Cosmetics Config (RepNotify variable) have to be applied on the server.

Demo of it.