-
What do you want to achieve? Keep it simple and clear!
I am trying to create a script where the player can pick up “dead” bodies. These dead bodies are said ragdolls and are created on a players death. The player has carry animations and the ragdoll has animations to be carried with. -
What is the issue? Include screenshots / videos if possible!
The issue is that ragdolls dont seem to come with Motor6Ds so they cant be animated and when adding Motor6Ds I cant seem to change their pivot point…
This is how the explorer looks
With the ragdoll
and this is the result when the animation tries to play
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried adding Motor6Ds to the ragdoll when interacting with it to no avail. I’ve tried checking the C0 of the Motor6D with no avail either. I’m just confused on how to tackle this problem.
This is the script im using
local UIS = game:GetService("UserInputService")
local AnimFolder = script.Parent:WaitForChild("CarryAnimations")
local characterA = game.Players.LocalPlayer.Character
local humanoidA = characterA:WaitForChild("Humanoid")
local animatorA = humanoidA.Animator
local playerMouse = game.Players.LocalPlayer:GetMouse()
local carryingAnim = AnimFolder:WaitForChild("Carrying")
local carryingTrack = animatorA:LoadAnimation(carryingAnim)
local carryingIdleAnim = AnimFolder:WaitForChild("CarryingIdle")
local carryingIdleTrack = animatorA:LoadAnimation(carryingIdleAnim)
local gettingCarriedAnim = AnimFolder:WaitForChild("GettingCarried")
local gettingCarriedTrack = animatorA:LoadAnimation(gettingCarriedAnim)
local gettingCarriedIdleAnim = AnimFolder:WaitForChild("GettingCarriedIdle")
local gettingCarriedIdleTrack = animatorA:LoadAnimation(gettingCarriedIdleAnim)
local function addMotors(character)
local torso = character.Torso
if not torso:FindFirstChild("Neck") then
local motor = Instance.new("Motor6D")
motor.Name = "Neck"
motor.Parent = torso
motor.MaxVelocity = 0.1
motor.Part0 = torso
motor.Part1 = character["Head"]
end
if not torso:FindFirstChild("Left Hip") then
local motor = Instance.new("Motor6D")
motor.Name = "Left Hip"
motor.Parent = torso
motor.MaxVelocity = 0.1
motor.Part0 = torso
motor.Part1 = character["Left Leg"]
end
if not torso:FindFirstChild("Right Hip") then
local motor = Instance.new("Motor6D")
motor.Name = "Right Hip"
motor.Parent = torso
motor.MaxVelocity = 0.1
motor.Part0 = torso
motor.Part1 = character["Right Leg"]
end
if not torso:FindFirstChild("Left Shoulder") then
local motor = Instance.new("Motor6D")
motor.Name = "Left Shoulder"
motor.Parent = torso
motor.MaxVelocity = 0.1
motor.Part0 = torso
motor.Part1 = character["Left Arm"]
end
if not torso:FindFirstChild("Right Shoulder") then
local motor = Instance.new("Motor6D")
motor.Name = "Right Shoulder"
motor.Parent = torso
motor.MaxVelocity = 0.1
motor.Part0 = torso
motor.Part1 = character["Right Arm"]
end
end
UIS.InputBegan:Connect(function(i,gp)
if i.KeyCode == Enum.KeyCode.F and playerMouse.Target.Parent:WaitForChild("RagdollHumanoid") then
local humanoidB = playerMouse.Target.Parent:WaitForChild("RagdollHumanoid")
local animatorB = humanoidB.Animator
print("Pressed F and hit a ragdoll!")
addMotors(humanoidB.Parent)
carryingIdleTrack:Play()
animatorB:LoadAnimation(gettingCarriedIdleAnim):Play()
end
end)
UIS.InputEnded:Connect(function(i,gp)
end)