hey guys, I’m making a second post on ragdolling because it’s so wonky
my ragdoll right now is always experiencing seizures, and I’m not sure what’s up with it
my first problem is with the head glitching(?) out on the floor (green parts are the collisions)
my second problem is with the collisions, I’ve tried a block collision and a pill collision, but both yielded the same results, as seen from the video above. I’ve also experienced a bug where it doesn’t fully touch the ground
this is the code I’ve used for the collision in the picture
modulescript code I wrote
local players = game:GetService("Players")
local repStorage = game:GetService("ReplicatedStorage")
local ragdollService = {}
local attachmentName = "BallSocketAttachment"
local bSocketConstraint = repStorage:WaitForChild("BallSocketConstraint")
local bodyPartSizes = {
["Head"] = Vector3.new(0.8, 0.8, 0.8),
["Torso"] = Vector3.new(1.8, 1.8, 0.8),
["Right Arm"] = Vector3.new(0.8, 1.8, 0.8),
["Left Arm"] = Vector3.new(0.8, 1.8, 0.8),
["Right Leg"] = Vector3.new(0.8, 1.8, 0.8),
["Left Leg"] = Vector3.new(0.8, 1.8, 0.8)
}
--Local functions
local function getMotor6Ds(character) : Motor6D
local listofMotors:Motor6D = {}
for _, v in character:GetDescendants() do
if v:IsA("Motor6D") and v.Parent == character:FindFirstChild("Torso") then
table.insert(listofMotors, v)
end
end
return listofMotors
end
--Service functions
function ragdollService:BuildCollisions(character)
for bodyPart, size in bodyPartSizes do
if character:WaitForChild(bodyPart) then
local selectedPart = character:WaitForChild(bodyPart)
local newCollision = Instance.new("Part")
local newWeld = Instance.new("WeldConstraint")
newCollision.Size = size
newCollision.CFrame = selectedPart.CFrame
newCollision.Transparency = 1
newCollision.CollisionGroup = "RagdollCollision"
newCollision.Parent = selectedPart
newWeld.Parent = newCollision
newWeld.Part0 = selectedPart
newWeld.Part1 = newCollision
end
end
end
function ragdollService:RagdollInit(player)
local char = player.Character or player.CharacterAdded:Wait()
local torso = char:WaitForChild("Torso")
local humanoid:Humanoid = char:WaitForChild("Humanoid")
--Disabling RequiresNeck
humanoid.RequiresNeck = false
humanoid.BreakJointsOnDeath = false
end
function ragdollService:ReplaceJoints(player)
local char = player.Character or player.CharacterAdded:Wait()
local humanoid:Humanoid = char:WaitForChild("Humanoid")
local motors = getMotor6Ds(char)
--To prevent moving during ragdoll
humanoid.PlatformStand = true
humanoid.AutoRotate = false
for name, motor in motors do
local attach1, attach2 = Instance.new("Attachment"), Instance.new("Attachment")
local bSocketClone = bSocketConstraint:Clone()
attach1.Name, attach2.Name = attachmentName, attachmentName
attach1.CFrame = motor.C0
attach2.CFrame = motor.C1
attach1.Parent = motor.Part0
attach2.Parent = motor.Part1
motor.Enabled = false
bSocketClone.Attachment0 = attach1
bSocketClone.Attachment1 = attach2
bSocketClone.Parent = motor.Part1
if name == "Right Hip" then
attach1.Position = Vector3.new(0.5, -1, 0)
elseif name == "Left Hip" then
attach1.Position = Vector3.new(-0.5, -1, 0)
end
end
end
return ragdollService
if anybody has any solutions, please help me out! thank you so much…