Hello, I’m trying to make some animated parts on a gun. The parts that I am trying to animate need to be joined to the gun using motor6D’s. The problem occurs when I equip the tool upon testing. The parts are all held together just fine, but within a few seconds the parts just disappear and get destroyed.
This is the tool script.
local tool = script.Parent
local handle = tool:WaitForChild("Handle")
--
local arms = {}
--
local function setupArms()
for _, arm in pairs(handle:WaitForChild("Arms"):GetChildren()) do
local newMotor6D = Instance.new("Motor6D")
newMotor6D.Part0 = handle
newMotor6D.Part1 = arm
--
newMotor6D.C0 = handle.CFrame:ToObjectSpace(arm.CFrame)
newMotor6D.C1 = CFrame.new()
newMotor6D.Parent = tool
--
arms[arm.Name] = {Inst = arm, Motor = newMotor6D}
end
end
--
setupArms()