Scripts Using PGS Physics Solver Now Won't Work

this should answer your question
https://developer.roblox.com/en-us/api-reference/function/Workspace/PGSIsEnabled

but I guess I can too :stuck_out_tongue: Its now used by default.

Since this is the only code in the script with it as a reference, and without knowing where your error lies, try removing this:

if not workspace:PGSIsEnabled() then
	warn(script:GetFullName(),"-","WARNING: Workspace.PGSPhysicsSolverEnabled is false. This may cause problems.")
end

There are no errors located within the output.

always offer an error code or something :slight_smile:

I removed it. It didn’t work at all. I want one of two things: This script to be fixed, or just a ragdoll script that makes it so your body parts DO NOT twist and they stay on their axis. I have code for a different ragdoll script that I’d need modified so body parts don’t twist and they move on their axis.

wait()
if script.Parent.Humanoid.RigType ~= Enum.HumanoidRigType.R6 then
	game.Debris:AddItem(script,1)
	else
wait()
function getAttachment0(attachmentName)
	for _,child in next,script.Parent:GetChildren() do
		local attachment = child:FindFirstChild(attachmentName)
		if attachment then
			return attachment
		end
	end
end
script.Parent.Humanoid.Died:Connect(function(var)
local removeHRP = true
local head = script.Parent["Head"]
local leftarm = script.Parent["Left Arm"]
local leftleg = script.Parent["Left Leg"]
local rightleg = script.Parent["Right Leg"]
local rightarm = script.Parent["Right Arm"]
local torso = script.Parent.Torso
local root =script.Parent.HumanoidRootPart
if removeHRP == true then
root:Destroy()
end
local rootA =Instance.new("Attachment")
local HeadA = Instance.new("Attachment")
local LeftArmA = Instance.new("Attachment")
local LeftLegA = Instance.new("Attachment")
local RightArmA = Instance.new("Attachment")
local RightLegA = Instance.new("Attachment")
local TorsoA = Instance.new("Attachment")
local TorsoA1 = Instance.new("Attachment")
local TorsoA2 = Instance.new("Attachment")
local TorsoA3 = Instance.new("Attachment")
local TorsoA4 = Instance.new("Attachment")
local TorsoA5 = Instance.new("Attachment")
function set1()
HeadA.Name = "HeadA"
HeadA.Parent = head
HeadA.Position = Vector3.new(0, -0.5, 0)
HeadA.Rotation = Vector3.new(0, 0, 0)
HeadA.Axis = Vector3.new(1, 0, 0)
HeadA.SecondaryAxis = Vector3.new(0, 1, 0)
LeftArmA.Name = "LeftArmA"
LeftArmA.Parent = leftarm
LeftArmA.Position = Vector3.new(0.5, 1, 0)
LeftArmA.Rotation = Vector3.new(0, 0, 0)
LeftArmA.Axis = Vector3.new(1, 0, 0)
LeftArmA.SecondaryAxis = Vector3.new(0, 1, 0)
LeftLegA.Name = "LeftLegA"
LeftLegA.Parent = leftleg
LeftLegA.Position = Vector3.new(0, 1, 0)
LeftLegA.Rotation = Vector3.new(0, 0, 0)
LeftLegA.Axis = Vector3.new(1, 0, 0)
LeftLegA.SecondaryAxis = Vector3.new(0, 1, 0)
RightArmA.Name = "RightArmA"
RightArmA.Parent = rightarm
RightArmA.Position = Vector3.new(-0.5, 1, 0)
RightArmA.Rotation = Vector3.new(0, 0, 0)
RightArmA.Axis = Vector3.new(1, 0, 0)
RightArmA.SecondaryAxis = Vector3.new(0, 1, 0)
RightLegA.Name = "RightLegA"
RightLegA.Parent = rightleg
RightLegA.Position = Vector3.new(0, 1, 0)
RightLegA.Rotation = Vector3.new(0, 0, 0)
RightLegA.Axis = Vector3.new(1, 0, 0)
RightLegA.SecondaryAxis = Vector3.new(0, 1, 0)
rootA.Name= "rootA"
rootA.Parent = root
rootA.Position = Vector3.new(0, 0, 0)
rootA.Rotation = Vector3.new(0, 90, 0)
rootA.Axis = Vector3.new(0, 0, -1)
rootA.SecondaryAxis = Vector3.new(0, 1, 0)
end
function set2()
TorsoA.Name = "TorsoA"
TorsoA.Parent = torso
TorsoA.Position = Vector3.new(0.5, -1, 0)
TorsoA.Rotation = Vector3.new(0, 0, 0)
TorsoA.Axis = Vector3.new(1, 0, 0)
TorsoA.SecondaryAxis = Vector3.new(0, 1, 0)
TorsoA1.Name = "TorsoA1"
TorsoA1.Parent = torso
TorsoA1.Position = Vector3.new(-0.5, -1, 0)
TorsoA1.Rotation = Vector3.new(0, 0, 0)
TorsoA1.Axis = Vector3.new(1, 0, 0)
TorsoA1.SecondaryAxis = Vector3.new(0, 1, 0)
TorsoA2.Name = "TorsoA2"
TorsoA2.Parent = torso
TorsoA2.Position = Vector3.new(-1, 1, 0)
TorsoA2.Rotation = Vector3.new(0, 0, 0)
TorsoA2.Axis = Vector3.new(1, 0, 0)
TorsoA2.SecondaryAxis = Vector3.new(0, 1, 0)
TorsoA3.Name = "TorsoA3"
TorsoA3.Parent = torso
TorsoA3.Position = Vector3.new(1, 1, 0)
TorsoA3.Rotation = Vector3.new(0, 0, 0)
TorsoA3.Axis = Vector3.new(1, 0, 0)
TorsoA3.SecondaryAxis = Vector3.new(0, 1, 0)
TorsoA4.Name = "TorsoA4"
TorsoA4.Parent = torso
TorsoA4.Position = Vector3.new(0, 1, 0)
TorsoA4.Rotation = Vector3.new(0, 0, 0)
TorsoA4.Axis = Vector3.new(1, 0, 0)
TorsoA4.SecondaryAxis = Vector3.new(0, 1, 0)
TorsoA5.Name = "TorsoA5"
TorsoA5.Parent = torso
TorsoA5.Position = Vector3.new(0, 0, 0)
TorsoA5.Rotation = Vector3.new(0, 90, 0)
TorsoA5.Axis = Vector3.new(0, 0, -1)
TorsoA5.SecondaryAxis = Vector3.new(0, 1, 0)
end
function set3()
end
spawn(set1);
spawn(set2);
	local HA = Instance.new("HingeConstraint")
	HA.Parent = head
	HA.Attachment0 = HeadA
	HA.Attachment1 = TorsoA4
	HA.Enabled = true
	HA.LimitsEnabled=true
	HA.LowerAngle=0
	HA.UpperAngle=0
	local LAT = Instance.new("BallSocketConstraint")
	LAT.Parent = leftarm
	LAT.Attachment0 = LeftArmA
	LAT.Attachment1 = TorsoA2
	LAT.Enabled = true
	LAT.LimitsEnabled=true
	LAT.UpperAngle=90
	local RAT = Instance.new("BallSocketConstraint")
	RAT.Parent = rightarm
	RAT.Attachment0 = RightArmA
	RAT.Attachment1 = TorsoA3
	RAT.Enabled = true
	RAT.LimitsEnabled=true
	RAT.UpperAngle=90
	local HA = Instance.new("BallSocketConstraint")
	HA.Parent = head
	HA.Attachment0 = HeadA
	HA.Attachment1 = TorsoA4
	HA.Enabled = true
	local TLL = Instance.new("BallSocketConstraint")
	TLL.Parent = torso
	TLL.Attachment0 = TorsoA1
	TLL.Attachment1 = LeftLegA
	TLL.Enabled = true
	TLL.LimitsEnabled=true
	TLL.UpperAngle=90
	local TRL = Instance.new("BallSocketConstraint")
	TRL.Parent = torso
	TRL.Attachment0 = TorsoA
	TRL.Attachment1 = RightLegA
	TRL.Enabled = true
	TRL.LimitsEnabled=true
	TRL.UpperAngle=90
	local RTA = Instance.new("BallSocketConstraint")
	RTA.Parent = root
	RTA.Attachment0 = rootA
	RTA.Attachment1 = TorsoA5
	RTA.Enabled = true
	RTA.LimitsEnabled=true
	RTA.UpperAngle=0
	head.Velocity = head.CFrame.lookVector*30
	
		for _,child in next,script.Parent:GetChildren() do
		if child:IsA("Accoutrement") then
			for _,part in next,child:GetChildren() do
				if part:IsA("BasePart") then
					part.Parent = script.Parent
					child:remove()
					local attachment1 = part:FindFirstChildOfClass("Attachment")
					local attachment0 = getAttachment0(attachment1.Name)
					if attachment0 and attachment1 then
						local constraint = Instance.new("HingeConstraint")
						constraint.Attachment0 = attachment0
						constraint.Attachment1 = attachment1
						constraint.LimitsEnabled = true
						constraint.UpperAngle = 0
						constraint.LowerAngle = 0
						constraint.Parent = script.Parent
					end
				end
			end
		end
	end
end)
end

Well, google is also you’re friend while you wait for someone to offer up the code. But you shouldn’t rely on that. Do some research and learn about constraints.

https://developer.roblox.com/en-us/articles/Constraints

You should consider creating your own ragdoll script, and then you’ll know exactly how it works (eventually)

I used Google. Google gave me Clone’s script. That’s…why I’m here.

thats not what I mean :smiley:

There’s a whole manual dedicated to how roblox studio works. It is your best friend. :stuck_out_tongue:

Im sure someone will come along and offer the code eventually, however I would like to aid you in the correct direction for learning programming and game development :slight_smile:

Please don’t disrespect others on the DevForum. Now, onto my question:

May I ask what rig you’re using for ragdolling? It’s important to know which rig type as both have some rather different methods of achieving a system as such.

3 Likes

Yes :clown_face:

I wouldn’t advise using old scripts of mine. They’re from a by-gone era when we had to use ugly hacks to pull off effects like this.

I wrote this code recently for applying ragdoll constraints to an R15 character:

The joints do twist instead of being constrained to a single axis, but you can easily configure it to just use hinges using the configuration table I provided. This also probably doesn’t work with R6 characters.

Now please, try not to be rude to your developer peers in the future.
While they weren’t being very helpful in this scenario, it’s better that you respectfully ask them to elaborate instead of throwing insults their way.

7 Likes

In the future please keep in mind this category is for asking for how to fix a piece of code, not to be spoon fed a new script. Also, please don’t be rude to other developers!

3 Likes

I’d also suggest analysing the code @Maximum_ADHD has provided so you have a deeper understanding of ragdoll and how to use it. Maybe even play around with it.

2 Likes

I would happen to be using R6, So I NEED an R6 ragdoll. Forget R15.

I believe you have that backwards. Let me explain.R6 is old, and most (If not all) updates are done for the R15, and most users use R15. Unless you’re going to be making custom avatars, but why R6?

and clonetrooper also offered you a solution ^^.

I want an R6 hinge ragdoll, that’s it. It’s for my R6 games.

Perhaps this ragdoll system could be helpful:

In the Settings, set the DEFAULTCONSTRAINT to "HingeConstraint"

Ooh, that could help! Thanks for the helpful answer.

I think we were all pretty helpful.

Out of curiosity, why R6?

yo hold up i just edited one of the old ragdoll scripts i got and changed the ball socket constraints to hinge constraints i’m good solution marked done