ELI5 How do I visualize attachments and motor6ds

Need help understanding commented code

local function createRagdoll(character, humanoid)
	humanoid.BreakJointsOnDeath = false 
	for _,v in pairs(character:GetDescendants()) do 
		if v:IsA("Motor6D") then 
			local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
			a0.CFrame = v.C0 -- So were setting attachment0's cframe to the motor6d's C0, I'm having trouble understanding c0 on the dev hub
			a1.CFrame = v.C1 -- 
			a0.Parent = v.Part0 --
			a1.Parent = v.Part1 --
			
			local b = Instance.new("BallSocketConstraint") -- Also how do i visualize a ballsocketconstraint? does it just keep attachments in the same space 
			b.Attachment0 = a0 --
			b.Attachment1 = a1 --
			b.Parent =v.Part0 --
			v:Destroy()
		end
	end
	character.HumanoidRootPart.CanCollide = false
	debris:AddItem(character, 15)
end




Attachments have a Visible property you can take advantage of, Attachment.Visible = true. Motor6D doesn’t however and you’d probably have to create a part or visible attachments to visualize that.

1 Like