I need to create a physics driven ragdoll that is simulated on a dedicated server and then replicated to the connected clients. The clients do not need to interact with the ragdoll in any direct way (you can think them as spectators).
Currently, the ragdoll is a blueprinted version of Owen from the Content Examples, with Owen wrapped into a single SkeletalMeshComponent (which is also the root component). The Blueprint itself is inherited from Actor.h.
If I check the Replicates and Replicate Movement checkboxes in the blueprint’s Defaults tab, the actor object itself and its root movement replicate fine (well, except that the latter seems to make the physics simulation extremely unstable). However, the pose of the ragdoll still becomes simulated separately on each client (they each see a different pose). What I have read from the forums, it seems that this is the intended default behavior of the engine: physics actors/components are not replicated by default.
Question 1: Is there any existing functionality in the engine to accomplish such a replication of a ragdoll pose, without having to copy the pose of the ragdoll manually on each frame?
Question 2: If there is no such functionality, then what would be the best way for replicating the pose manually (programming effort and performance-wise)? Is it possible to somehow take a “snapshot” of the ragdoll’s pose on the server, replicate that, and then apply it client-side? Or would it make any sense to replicate the transformation of each bone separately?
I am still rather new to the engine, so I’m a bit lost here. Any help is highly appreciated!
I am currently working with blueprints, but I am comfortable with C++ too (and what comes to performance, that is what the final solution probably needs to be anyways?).