my ragdolls are lagging, i’ve tried making the humanoidrootpart massless, this does work however this makes the ragdoll have slippery movement and slow shiftlock as shown in this video: Watch Desktop 2024.10.20 - 19.55.18.16 | Streamable
local rag = char:WaitForChild("IsRagdoll")
local root = char:WaitForChild("HumanoidRootPart")
local clonedCharacter = nil
task.wait(1)
print("active ragdoll on " .. char.Name .. " activated")
--root.RootJoint.Enabled = false
--root.TEMPORARY_ROOTJOINT.Enabled = true
--root.Massless = true
--root.rootjoint_unused.Enabled = false
--root.RootJoint.Enabled = true
clonedCharacter = Instance.new("Model")
clonedCharacter.Parent = char
local clonedLimbs = {}
for _, v in pairs(char:GetChildren()) do
if v:IsA("BasePart") then
v.CollisionGroup = "char"
local newLimb = Instance.new('Part')
newLimb.Size = v.Size
newLimb.CanCollide = false
newLimb.CanQuery = false
newLimb.CanTouch = false
newLimb.Massless = true
newLimb.Anchored = false
newLimb.Name = v.Name
newLimb.Transparency = 1
newLimb.Parent = clonedCharacter
newLimb.Color = Color3.fromRGB(math.random(1, 255),math.random(1, 255), math.random(1, 255))
table.insert(clonedLimbs, v)
end
end
for _, v in pairs(clonedCharacter:GetChildren()) do
if v:IsA("BasePart") and v.Name ~= "Torso" then
if v.Name == "HumanoidRootPart" then
local newJoint = Instance.new("Motor6D")
newJoint.Enabled = true
newJoint.Part1 = clonedCharacter.Torso
newJoint.Part0 = v
newJoint.Name = "RootJoint"
newJoint.C0 = root.RootJoint.C0
newJoint.C1 = root.RootJoint.C1
newJoint.Parent = v
local newjoint2 = newJoint:Clone()
newjoint2.Part1 = root
newjoint2.Part0 = v
newjoint2.Name = "connectir"
newjoint2.Parent = root
else
local newJoint = Instance.new("Motor6D")
newJoint.Enabled = true
newJoint.Part1 = v
newJoint.Part0 = clonedCharacter.Torso
newJoint.Name = motor6ds[v.Name]
newJoint.C0 = char.Torso[motor6ds[v.Name]].C0
newJoint.C1 = char.Torso[motor6ds[v.Name]].C1
newJoint.MaxVelocity = char.Torso[motor6ds[v.Name]].MaxVelocity
newJoint.Parent = clonedCharacter.Torso
--print(newJoint.Part0.Parent)
--print(newJoint.Part1.Parent)
end
end
end
for i, v in pairs(clonedLimbs) do
if v:IsA("BasePart") then
--print(v)
local clonedLimb = clonedCharacter:FindFirstChild(v.Name)
if not clonedLimb then
table.remove(clonedLimbs, i)
continue
end
local attachment = Instance.new('Attachment', v)
local clonedAttachment = Instance.new('Attachment', clonedLimb)
local orientation = Instance.new('AlignOrientation')
orientation.Name = v.Name
orientation.CFrame = clonedLimb.CFrame
orientation.Attachment0 = attachment
orientation.Attachment1 = clonedAttachment
orientation.ReactionTorqueEnabled = true
orientation.RigidityEnabled = true
orientation.MaxTorque = 3000
orientation.Responsiveness = 200
orientation.Parent = v
end
end
runService.Stepped:Connect(function()
for _, v in pairs(char:GetChildren()) do
if v:IsA("BasePart") and v.Name ~= "Torso" and v.Name ~= "HumanoidRootPart" then
local clone_limb = clonedCharacter:FindFirstChild(v.Name)
local ao = v:FindFirstChildWhichIsA("AlignOrientation")
ao.CFrame = clone_limb.CFrame
end
end
for _, v in pairs(clonedCharacter:GetChildren()) do
if v:IsA("BasePart") then
v.CanCollide = false
v.Massless = true
end
end
end)
rag.Value = true
Why are you using AlignOrientation anyway? I haven’t seen any other ragdoll scripts use it.
They usually only use BallSocketConstraints. So what are you using them for?
I’m not sure I understand what you’re doing there, but I think you’re cloning the character and then aligning the clone to the actual character so the clone is animated or the other way around.
I don’t even understand why you have to have a clone in the first place tbh. Seems to me that if you get rid of it, it would fix the issue.
it is an active ragdoll that i am making and there’s no other way around to make it animated other than use springconstraints or alignorientation (which is the best option), the problem is that the ragdoll lags on the server and from other client’s perspectives
doubt that the clone is the root cause of it, without the clone the active ragdoll code wouldn’t work, and yes the clone is necessary. the ragdoll is definitely the root cause of it, however as i said if i try to remedy the ragdoll lag by setting the humanoidrootpart massless to true, there are side effects such as the player having slippery movement and slow shiftlock: Watch Desktop 2024.10.20 - 19.55.18.16 | Streamable