Set one of the character’s bodyparts’s network ownership to the player after the boolvalue gets set to true once they die. I set the torso’s network ownership and it worked for me.
Anyways, good ragdoll system, I had a ragdoll on death script and I wanted to make it have temporary ragdoll, this saved me a lot of time.
Only problem I came across was that animations still played once you get non-death ragdolled, but I fixed it by just stopping all animations on the client when the player gets ragdolled. (although sometimes you might not have any animations when you get up from ragdoll until you walk, but that’s fine.)
Nice system, performant and barebones, as it should be
Been grappling with one physics issue for a while now. Was hoping maybe your experience working with ragdolls may provide clarity?
When the character is floating in water, I enable the ragdoll and make each assembly in the character anti-gravity by using a vectorforce with force set to AssemblyMass * workspace.Gravity. However, I noticed that when all these anti-gravity assemblies(the body parts of the character) are connected by the ball sockets, the character floats up when moving, which should not occur:
Do ball sockets exert a force? How can I ensure that the anti-gravity version of the ragdoll remains anti-gravity even when moving?
I’m pretty sure that the ball sockets somehow affect the velocity of the connected assemblies, unless, which I highly doubt, the ragdoll humanoid state exerts a constant upwards force.
Now how do I use this? I see that it ragdolls on death, but how do I make it like for example I want a part to ragdoll you? You don’t really explain it so some explanation would be nice, thank you!
there’s a BoolValue on the player’s Character, you can get it with Character:WaitForChild(“IsRagdoll”)
here’s the code
workspace.Part.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) then
if hit.Parent:FindFirstChild("IsRagdoll") then
hit.Parent:FindFirstChild("IsRagdoll").Value = true
task.wait(0.5)
hit.Parent:FindFirstChild("IsRagdoll").Value = false -- unragdoll after 0.5 seconds
end
end
end)
Thank you for the suggestion, but this unfortunately didn’t solve the problem.
I’ve also tried changing the ragdoll humanoid state to physics(as I’m very sure the physics state exerts no force), but this changed nothing. I’ve formulated a test to isolate the source of the upwards force, and though I’m not 100% certain, I’m pretty sure the BallSocketConstraints are the culprit. In theory two anti-gravity assemblies connected by a ball socket should still be anti-gravity, but I think in Roblox’s engine the ball sockets are causing unwanted(though small) upwards forces.
In my test, every limb has the right “anti-gravity” vectorforce Force, and is collisionless.
The ball sockets that connect the limbs have no LimitsEnabled. MaxFrictionTorque is 0.
Despite all this, the more the limb twists around the ball socket, the more the character is sent upwards.
you could just make a separate invisible character that is always with the current player’s character and when the player’s character ragdoll in water, use the invisible character to position the player’s character every frame. Then stop using it whenever the player is not ragdolled or in water.
Or even better just use a invisible part. This wouldnt be hard to do since the player shouldnt move when they are ragdolled.
Thanks so much for this recommendation—it set off a lightbulb moment in my head:
Completely disconnect the torso from rootpart(No Motor6D, no ball socket, no rope, no spring connecting them), then add an AlignPosition with ReactionForce Enabled to connect them instead. This way the rootpart is more independent from the idiosyncrasies of the limbs’ movements. Then, since the rootpart no longer bears the mass of the body, just use CustomPhysicalProperties to add the mass of the limbs onto the rootpart so it moves normally. By doing this, I have been able to experience 0 unwanted forces.
I could not have gotten to this point without your code and through six solid months of tinkering with it, I have learned a whole lot about character physics!
Hey im using this Script and it seems that theres a large lag between the torso and its limbs on both client and server. Whenever i trigger the ragdoll on a npc with knockback added, their torso moves normally while the limbs and head dont. When i try with players, everyone(Including the server) except the player that got hit sees the limbs lagging. Any idea how to deal with this? I dont know how to provide footage because roblox wont let me.