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.
Since this wasn’t solved, I’d like to end this query. It happened with me too and I figured it out after a week but it was a long time ago. So, here you go. The humanoid is trying to get up like @KhanPython said. But you cannot solve it by making platform stand to true.
You have to disable getting up first then change state to ragdoll when you ragdoll. Incase you want to make the player get up, you have to enable getting up then change state it to getting up to get faster results otherwise it will get up in a bit automatically.
if bool == true then
H:SetStateEnabled(Enum.HumanoidStateType.GettingUp,false)
H:ChangeState(Enum.HumanoidStateType.Ragdoll)
H.Animator:Destroy()--smoother ragdoll
else
Instance.new("Animator",H)
char.Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp,true)
char.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
This has to be done through client as Server cannot do this. So, I fire a remote event to do this. bool is true when i have to ragdoll player and it’s nil/false when I have to get player up again.
Hope I helped!
Edit: You have to delete animator as for some reason animations keep happening which make the character bouncy. It’ll lead to some errors in LoadAnimation scripts occasionally but that won’t be an issue.
Try to do call this method before your ragdoll function:
Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)