Nope, it just keeps on flying. And I feel like this is still my error.
Let me see the full behaviour of this ragdoll. This might take time.
I have tried this in baseplate, everything works fine and character ragdolls as he should. I’ve noticed that this scrpt doesn’t work with R6.
I think that this affects only your game. Try to find anything that interacts with character in any way.
That doesn’t make sense, everything was normal without the ragdoll and it only flings you into the air when you ragdoll.
I think that the tool is the cause for this. Try to save your tool to a file, open a baseplate, insert an R15 rig (plugins tab → rig builder), insert your tool into starter pack and see if it still flies.
I inserted the ragdoll script in a random baseplate without the weapon and called it on the character when the player is added and it still flies.
Here are both scripts if needed.
Server:
game.ReplicatedStorage.Remotes.Ragdoll.OnServerEvent:Connect(function(p,char)
local d = char:GetDescendants()
for i=1,#d do
local desc = d[i]
if desc:IsA("Motor6D") then
local socket = Instance.new("BallSocketConstraint")
local part0 = desc.Part0
local joint_name = desc.Name
local attachment0 = desc.Parent:FindFirstChild(joint_name.."Attachment") or desc.Parent:FindFirstChild(joint_name.."RigAttachment")
local attachment1 = part0:FindFirstChild(joint_name.."Attachment") or part0:FindFirstChild(joint_name.."RigAttachment")
if attachment0 and attachment1 then
socket.Attachment0, socket.Attachment1 = attachment0, attachment1
socket.Parent = desc.Parent
desc:Destroy()
end
local new = Instance.new("BodyVelocity")
new.Velocity = Vector3.new(0,-100,0)
new.Parent = char.HumanoidRootPart
end
end
end)
Client:
local p = game.Players.LocalPlayer
game.ReplicatedStorage.Remotes.Ragdoll:FireServer(p.Character)
game.ReplicatedStorage.Remotes.Killed.OnClientEvent:Connect(function(player)
game.SoundService.SoundEffects.Kill:Play()
game.ReplicatedStorage.Remotes.Ragdoll:FireServer(player.Character)
end)
Bruh. It also happened to me. Thirty characters.
You’re getting launched into the air as well?
Should I move this post to #platform-feedback:engine-bugs?
I found the fix. When character ragdolls, his Humanoid.HipHeight
is 2. Setting it to 0 descends you back.
Thank you, but why is the camera like that? Is there anyway to fix it? Also, I’ve used this same script before and I’ve never needed to do that.
Camera always follows HumanoidRootPart
, which doesn’t have a constraint. A constraint that connects HumanoidRootPart.RootRigAttachment
with UpperTorso.WaistRigAttachment
will fix the character being dragged around.
Not sure what you mean, I’m just saying that the camera is slightly off.
Err… Post the updated script please. I’ve put char.Humanoid.HipHeight = 0
at the end, which causes my character to drag around.
game.ReplicatedStorage.Remotes.Ragdoll.OnServerEvent:Connect(function(p,char)
char.Humanoid.HipHeight = 0
local d = char:GetDescendants()
for i=1,#d do
local desc = d[i]
if desc:IsA("Motor6D") then
local socket = Instance.new("BallSocketConstraint")
local part0 = desc.Part0
local joint_name = desc.Name
local attachment0 = desc.Parent:FindFirstChild(joint_name.."Attachment") or desc.Parent:FindFirstChild(joint_name.."RigAttachment")
local attachment1 = part0:FindFirstChild(joint_name.."Attachment") or part0:FindFirstChild(joint_name.."RigAttachment")
if attachment0 and attachment1 then
socket.Attachment0, socket.Attachment1 = attachment0, attachment1
socket.Parent = desc.Parent
desc:Destroy()
end
local new = Instance.new("BodyVelocity")
new.Velocity = Vector3.new(0,-100,0)
new.Parent = char.HumanoidRootPart
end
end
end)
workspace.CurrentCamera.CameraSubject = p.Character.Head
on client’s side will make the camera focus on character’s head.
I’ve also noticed that this script creates 15 BodyVelocity
objects, which isn’t quite good.
I’ve noticed that you get dragged along the floor, any way to fix this?
I got dragged around the floor because I removed all BodyVelocities
. Adding at least one with enough force will fix it.
Probably late, but I realized that this is what happens when the Humanoid is trying to stand up. What you should do is enable Platform standing when the character dies/goes ragdoll.