hey there, I just want to say this topic is gonna have a quite a few questions, but I don’t mind how many that you answer, as long as it helps :))
lately, I’ve been making a ragdoll system for my game, and I wanna improve on it as much as I can
here are the questions:
when retrieving the state of the player (ragdolled or not), should I use a remote function callback or use attributes on the character?
who should be given network ownership during ragdoll?
how do I prevent flinging/weird collisions?
this ragdolling module uses the original Motor6D joint’s CFrame, but I’m not satisfied with the results, how would I create a custom joint mapping for each part? (was planning to use a modulescript with the settings, but not sure if that’s the most efficient way)
I want to try to recreate The Strongest Battleground’s ragdoll system, which looks really fluid and realistic, any tips on how to achieve this?
should I store ragdoll attributes on the character itself?
I also seem to be encountering a physics bug, where the ragdoll doesn’t touch the ground although there’s nothing in the way and the ragdoll collisions are working fine.
you dont have to create attachments for limbs, roblox rigs already have attachments in places where limbs connect
player have network ownership of his character, so no exception for his ragdoll unless that dead body
since you cant make limbs collidable, you can create invisible hitbox inside each limb and weld it like that, and to prevent flinging you can try to apply some upward force to rig before enabling his motor6d’s
you can prevent flinging by teleporting rootpart right before enabling motor6d’s
local position = character.PrimaryPart.Position -- humanoidrootpart
local hipheight = character.Humanoid.HipHeight
character:PivotTo(CFrame.new(position + Vector3.new(0, hipheight + 1, 0)) -- plus one because of rootpart size
to properly rotate character when he standing up you can use direction from rootpart to head and direction what head is looking
local position = character.PrimaryPart.Position
local headPosition = character.Head.Position
local fromHeadDirection = headPosition - position
local facingUp = character.Head.CFrame.LookVector.Y > 0
local resultPosition = position + Vector3.new(0, hipheight + 1, 0)
local resultDirection = fromHeadDirection.Unit * Vector3.new(1, 0, 1) * (facingUp and 1 or -1)
character:PivotTo(CFrame.lookAlong(resultPosition, resultDirection))