How to do client ragdoll on NPCs?

One of the biggest issues currently in my game that I’ve been battling in my development for my game for months is simulation and one of the biggest solutions I’ve found to reducing that is to disable the ragdoll welding effects on the server.

I was basically confused on how my game was causing so much simulation (which caused lag) since I’ve done the majority of special effects and even environmental animation effects on client for so long. I’ve only discovered that the simulation serverjob goes down tremendously until I disabled the effects caused by ragdolls for my NPCs. Now looking back upon it, it makes sense considering that I would have a maximum of 60-100 humanoid NPCs per round in my game possibly going into ragdoll mode.

Now I’ve been trying to do ragdoll effects on the client but I keep getting weird results because it works and doesn’t work at the same time, consistently doesn’t work most of the time.


What I’m doing is that when a NPC dies, on the server it removes their motor6d joints and tools and I handle other necessary things for the server and then I’m telling the server to fire to the clients the ragdoll joints attachments. I think the issue has to do with networking because all of my npcs have setnetworkownership to nil which I’m not willing to adjust. Have no clue on how to do a hacky way to bypass this, any ideas?

1 Like

Perhaps try to make everything on the client, including removing the motor6d joints.
Here’s a flowchart to give you an idea on what I mean :smiley:
Screen Shot 2020-12-27 at 4.00.35 PM

1 Like

I appreciate the answer especially with the visual chartflow but I realize I actually can’t do this; I also make npcs go into ragdoll mode when they get ‘concussions’ and the game acts really weird when I do the on death ragdoll such as ragdolls flying endlessly in one direction or maybe I’m overthinking or underthinking and cramping farting my code too weirdly because it is kinda really late for me.

Humanoid.BreakJointsOnDeath is exits, so you dont have to clone a character, etc.

But don’t forget to use this code in ServerScript.

I use Humanoid.BreakJointsOnDeath but the main problem is simulation caused from it being used on the server which is why I am trying to convert it to the client. The problem is that it seems like you can’t edit no welds unless you clone the NPC’s dead body which I want to avoid because it cause a lot of problems for me.

I can’t explain much right now, but have a look at this post until I can get on on pc tmrw

Yeah I was having a poo poo moment yesterday, the flow chart helped me with my issue and has reduced down a lot of simulation. Can’t do nothing about concussions but concussions happen a lot less frequently than deaths so thanks so much for the help.

1 Like