This problem started when I wanted to make a r6 ragdoll for my new fighting game, the simple problem was that the limbs of the player would simply not collide with the default collision group, resulting in something like this :
I would like to know if there is a way to make it so the arms don’t collide with the floor for example, since that looks extremely weird, any idea on what could I do?
Code :
local players = game.Players
local pService = game:GetService("PhysicsService")
pService:CreateCollisionGroup("BodyParts")
pService:CollisionGroupSetCollidable("BodyParts", "Default", true)
pService:CollisionGroupSetCollidable("BodyParts", "BodyParts", true)
function createGlue(part0, part1, name, char)
local glue = Instance.new("Glue", char.Torso)
glue.Part0 = part0
glue.Part1 = part1
glue.Name = name
return glue
end
players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:connect(function(char)
local motorParts = {char.Torso["Right Hip"],char.Torso["Left Hip"], char.Torso["Right Shoulder"], char.Torso["Left Shoulder"]}
local isTrip = char:WaitForChild("isTrip")
for i,v in pairs(char:GetChildren()) do
if v.Name == "Right Leg" or v.Name == "Right Arm" or v.Name == "Left Leg" or v.Name == "Left Arm" then
local glue = createGlue(char.Torso, v, v.Name, char)
pService:SetPartCollisionGroup(v, "BodyParts")
if v.Name == "Right Leg" then
glue.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
glue.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
end
if v.Name == "Left Leg" then
glue.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
glue.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
end
if v.Name == "Right Arm" then
glue.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
end
if v.Name == "Left Arm" then
glue.C0 = CFrame.new(-1.5, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
glue.C1 = CFrame.new(0, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
end
end
end
isTrip:GetPropertyChangedSignal("Value"):connect(function()
if isTrip.Value == true then
for i,v in pairs(motorParts) do
v.Part0 = nil
end
char.Humanoid.PlatformStand = true
end
if isTrip.Value == false then
for i,v in pairs(motorParts) do
v.Part0 = char.Torso
end
char.Humanoid.PlatformStand = false
end
end)
end)
end)