I have a ragdoll, I want to connect the players foot to a constraint so they float in the air but when I do that and the player is in ragdoll it tries to automatically reset the motor6ds is there a way to stop it? I tries disabling them and I fell through the floor.
I did mention maybe I didn’t explain it well (most likely) but when I did disable the motor6d I fell through the ground. The animate script is also disabled when I go into ragdoll mode.
You can try this script bellow which is a kinda temp ragdoll script I found it with some people who were having kinda the same problem :
– Edit the script based off of what your working on.
local Character = game.Players.LocalPlayer.Character
local Hm = Character:WaitForChild(“Humanoid”)
local HmHRP = Character.HumanoidRootPart
local UIS = game:GetService(“UserInputService”)
local Ragdolling = Instance.new(“BoolValue”)
Ragdolling.Value = false
Ragdolling.Parent = Character
local SocketType = “BallSocketConstraint”
local RagdollKey = Enum.KeyCode.R – Chose what you’d put…
UIS.InputBegan:connect(function(input)
if input.KeyCode == RagdollKey then
local PlayerParts = Character:GetDescendants()
for i,M6D in pairs(PlayerParts) do
if M6D:IsA(“Motor6D”) then
if M6D.Name ~= “Root” then
if not M6D.Parent:FindFirstChildWhichIsA(SocketType) then
local Socket = Instance.new(SocketType)
M6D.Parent = M6D.Part1
Socket.LimitsEnabled = true
Socket.Radius = .25
Socket.TwistLimitsEnabled = false
Socket.TwistLowerAngle = 360
Socket.TwistUpperAngle = -180
Socket.UpperAngle = 90
local M0,M1
if not M6D.Part0:FindFirstChild(M6D.Name … “RigAttachment”) then
print(“A”)
M0 = Instance.new(“Attachment”)
M0.Name = M6D.Name … “RigAttachment”
M0.Parent = M6D.Part0
M0.CFrame = M6D.C0
print(M0.Name … “A0”)
end
if not M6D.Part1:FindFirstChild(M6D.Name … “RigAttachment”) then
M1 = Instance.new(“Attachment”)
M1.Name = M6D.Name … “RigAttachment”
M1.Parent = M6D.Part1
M1.CFrame = M6D.C1
print(M1.Name … “A1”)
end
Socket.Parent = M6D.Parent
Socket.Attachment0 = M6D.Part0:FindFirstChild(M6D.Name … “RigAttachment”)
Socket.Attachment1 = M6D.Part1:FindFirstChild(M6D.Name … “RigAttachment”)
game.Workspace.CurrentCamera.CameraSubject = Character.Head
M6D.Enabled = false
Hm:ChangeState(Enum.HumanoidStateType.Physics)
Ragdolling = true
HmHRP.CanCollide = false
end
end
end
end
end
end)
UIS.InputEnded:connect(function(input)
if input.KeyCode == RagdollKey then
local PlayerParts = Character:GetDescendants()
if Ragdolling == true then
for i,M6DBSC in pairs(PlayerParts) do
if M6DBSC:IsA(SocketType) then
M6DBSC:Destroy()
elseif M6DBSC:IsA(“Motor6D”) then
M6DBSC.Enabled = true
end
end
HmHRP.CFrame = HmHRP.CFrame + Vector3.new(0,2,0)
HmHRP.CanCollide = true
game.Workspace.CurrentCamera.CameraSubject = Character.Humanoid
Hm:ChangeState(Enum.HumanoidStateType.GettingUp)
end
end
Good idea, I think this confirms my suspicion that its the fault of the humanoid and thats why it works when the humanoid dies. It’s probably to do with the humanoid state type.
Edit: Hmm,
Did you replace the motor6d with a ball socket constraint like the example script? If not then the limb probably detached and thats why the player fell through the ground.