Need help with ragdoll?

Explination:
Once the player hits the rock it ragdolls but then the character flys up into the sky cause of the problem have no i dea? || Video clip below & the code is below the video

Dont mind the music in the background was listening to something…

Code

newShard.Touched:Connect(function(touch)
if touch.Parent:FindFirstChild("Humanoid") and touch.Parent ~= plr.Character and not charactersHit[touch.Parent] then
				
				charactersHit[touch.Parent] = true

				for _, v in pairs(touch.Parent:GetDescendants()) do
					if v:IsA("Motor6D") then
						local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
						a0.CFrame = v.C0
						a1.CFrame = v.C1
						a0.Parent = v.Part0
						a1.Parent = v.Part1
						local b = Instance.new("BallSocketConstraint")
						b.Attachment0 = a0
						b.Attachment1 = a1
						b.Parent = v.Part0
						v.Enabled = false
						
						touch.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
						touch.Parent.HumanoidRootPart.CanCollide = false
						touch.Parent.Humanoid.BreakJointsOnDeath = true
						touch.Parent.Humanoid.RequiresNeck = false
					end
				end
				wait(3)
				
				touch.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
				touch.Parent.HumanoidRootPart.CanCollide = false
				touch.Parent.Humanoid.BreakJointsOnDeath = true
				touch.Parent.Humanoid.RequiresNeck = false
				
				for _,v in pairs(touch.Parent:GetDescendants()) do
					if v:IsA('Motor6D') then
						v.Enabled = true
					end
					if v.Name == 'BallSocketConstraint' then
						v:Destroy()
					end
					if v.Name == 'Attachment' then
						v:Destroy()
					end
				end
			end
		end)
2 Likes

This might have something to do with the trajectory of the player.
When the shard hits, it sends the player up the moment the ragdoll starts.
This could cause an error and send the player flying, it happens in other games that use ragdoll such as Reason 2 Die Awakening.

2 Likes

ah never mind i fixed the issue just made it so when the player ragdolls they sit and once the ragdoll is finished just made sit to false n it fixed the issue :man_shrugging: