I made an R6 ragdoll system which is basically BallSocketConstraints placed between the R6 limbs that turn on while turning off the Motor6Ds to start the ragdoll, and vise versa to go off ragdoll. For more details you can check this forum post showcasing it.
So the problem I am having with it is this:
As you can see in the video, the torso disconnects with everything and then snaps back and it’s smooth from there, but that snapping occures on the clients only, so it’s likely a replication issue, what backs that up is that the server sees the ragdoll without snapping:
I dunno if my suggestion works but it would probably be my first go to solution:
setting up the ragdoll effects on the server while whatever you need is still on the client.
I think this will work in general because the problem is the client is causing the disconnection right?
The client is causing nothing, the ragdoll is already happening in the server, the problem is that the client doesn’t see the change live, it hicups for a split second then behaves normaly (as seen before and after the arrow in the video)
Have you initially set the network owner of the NPC to nil? Perhaps it delays due to network owner changes(the player can change the networkowner of parts that are near them)
So all the clients see the hiccup when 1 player ragdolls an NPC (which is controlled by the server). And the ragdoll is done on the server.
Yeah I agree that setting the NPC’s network ownership to the client who is attacking and then ragdolling from that client will look the smoothest for all clients. As far as security warrants, I think it’s worth the smoothness over the chance an exploiter manages to take the NPC and move it somewhere else. It’s just useless if an exploiter network owns the NPC after punching it.
It’s very much not “useless” if an exploiter has network over the NPC, they can instantly kill it and all sort of things, and that NPC is just a placeholder, chances are they’ll be fighting another player. And I don’t think it’ll look smooth if the player attacking has network ownership, because what if the player’s internet isn’t stable, now them and the person who they knocked will lag and all sorts of delayed stuff will happen.
I might be wrong but I think Network Ownership won’t let them control the Humanoid properties like Health MaxHealth etc. And as far as the issues you described, I don’t think that is as bad as you think it is. The punch from the attacking player making contact with the NPC will look smooth. If there’s this awkward delay in between it won’t look as smooth.
I might also be wrong about being able to control those, but I am certain if the client who has network ownership lags, they ragdoll knock will also look laggy.
That’s good thinking, but unfortunately it didn’t work, I already tried that.
What seems to work now is that I switched from using :ApplyImpulse to using a VectorForce on the hrp, and it’s much smoother.
You can still see the hiccup, but it’s not as severe.
The HumanoidRootPart, but that doesn’t matter in my case because they are both welded together on ragdoll so that when the player stands up, their hrp is in the correct position.
I went from using :ApplyImpulse to using a VectorForce on the HumanoidRootPart and that seems to make it smoother, only drawback is that the knockback isn’t as instant, it’s a tiny bit delayed because the VectorForce applies force over time, not instantly like ApplyImpulse does.