Download

Ragdoll replication (client issue)

Hey guys !
I’m making a multiplayer game where the player character can go ragdoll when hit by something and/or another player.
Issue is that from the client point of view, his mesh is detached from the capsule and out of sync with what the server is seeing.
In offline/server mode the mesh stays inside his capsule and everything works fine, even when watching other clients go ragdoll it’s all good, but from the clients pov his mesh goes somewhere else, so when he goes out of ragdoll mode it seems like he teleported which is weird.

I tried RPCs, Repnotify, a lot of different configs, this is the best i get…

I don’t need the whole ragdoll animation to be replicated, but at least its position so it wont seem like he weirdly teleported out of nowhere

The whole code is in 2 parts, one for going in/out ragdoll (img 1 and 2), and the other to keep the mesh inside the capsule (event tick when ragdoll mode, img 3)

I spent a few day on that and I don’t know anymore where to look at to fix this so any help would be appreciated

Thanks !



During rag-doll disable capsule collisions and ensure that the capsule moves to the mesh, I would look into root motion examples that show keeping the capsule component where it needs to be.

I tried to disable capsule collisions but it didn’t work.
For the capsule moving with the mesh i thought that was what i’m doing so if there’s a better way to do it can you show me ?
For the part about root motion i read the documentation but i don’t understand how it’s going to help me with the ragdoll part, especially when it works as expected on server/offline.

I’m a beginner so can you explain a bit more please ?

Ragdoll is applied to the mesh, so when your charter starts its tumble the capsule stops right where its at. so if you kick the mesh you will continue to move the mesh away from the capsule. When an animation runs in root motion the mesh moves without the capsule. I am simply suggesting you ensure the capsule position sticks with the mesh during its ragdoll state.

1 Like