When the character dies while standing, the character stands still and doesnt fall until you move it
function ragdoll:newragdoll(character,respawntime)
for index,joint in pairs(character:GetDescendants()) do
if joint:IsA("Motor6D") and joint:FindFirstAncestor("Accessories") == nil then
--if joint:FindFirstAncestor("Accessories") then return end
local socket = Instance.new("BallSocketConstraint")
local a1 = Instance.new("Attachment")
local a2 = Instance.new("Attachment")
a1.Parent = joint.Part0
a2.Parent = joint.Part1
socket.Parent = joint.Parent
socket.Attachment0 = a1
socket.Attachment1 = a2
a1.CFrame = joint.C0
a2.CFrame = joint.C1
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
--joint.Parent.CanCollide = true
joint:Destroy()
end
end
end
i’ve tried giving it force but it doesnt even move and idk why and how to fix this
alr i have found a way by adding linearvelocity and this time it works. i also added raycast to detect if the character is in the air so he doesnt flip, althought is there a better way to do this?
If the character being ragdolled is an NPC and has no client attached to it- set the HumanoidRootPart’s network ownership to nil then repeat the same code above but run the aforementioned code above on the server.
this doesnt work because it makes all the scripts be on a constant loop for some unknown reason (im talking about the physics) and it also doesnt make my player fall down
Did you run my code on the client? Is your ball and socket joint code script on the server or client? If on the server have you tried utilizing RemoteEvents to run my aforementioned code? Please let me know!
i apologize for the wait, as im quite busy nowadays with exams, the ballsocketjoint is run on the server after the humanoid has died, then, it runs a module script, which runs the ballsocket join function. i put your code on the client by simpling putting humanoid.died:connect(function()) event, i even did use this on the server too but for some reason it does the same problem
hello im back, i fixed the code you sent to me. i was thinking of a way to use the function without on the loop, and i found out that using once instead of connect fixed the loop. it made the fall much smoother, howerver, the standing problem still occurs. and i really dont know if using raycast and linearvelocity is an efficent way