Download

Skeletal Mesh replication across server to all clients

Hi, I’m building a multiplayer game and the goal is for the skeletal mesh to get binded to the clients on registration during runtime (to each his own).
The problem is that when each client enters the game all the characters on the server get the skeletal mesh that we wanted to assign to him. Was thinking about using certain GetLocalRole() and GetRemoteRole() functions before assigning the mesh but was not sure how to go about this. The source code is something like:

GetMesh()->SetSkeletalMesh(ourInstance->thisSessionMesh); // the bug is that thisSessionMesh gets assigned to all the clients

Could someone maybe help me with that?

Yes, that is the basic idea.

You could do something like:

Local Client:
Tell my character to use MeshA.

Server:
Set mesh variable to MeshA.

Is this a listen server?
Set the skeletal mesh component to use the mesh variable.

Replicate the mesh variable to everyone.

All Clients:
Set the skeletal mesh component to use the replicated mesh variable.