Motor6D not adding itself onto the players HumanoidRootPart

Hello there.

I’ve created a simple script inside of ReplicatedStorage which simply adds a Motor6D on the player’s HumanoidRootPart. The issue is that it just doesn’t want to? No errors fyi.

--//Fairly simple script
game:GetService("Players").PlayerAdded:Connect(function(Plr)
	Plr.CharacterAdded:Connect(function(Char)
		local Motor6DGrip = Instance.new("Motor6D",Char.PrimaryPart)
		Motor6DGrip.Part0 = Char.PrimaryPart

		Char.ChildAdded:Connect(function(Child)
			if Child:IsA("Tool") and Child:FindFirstChild("ToolGrip") then
				Motor6DGrip.Part1 = Child.ToolGrip

				Char.ChildRemoved:Connect(function(Child)
					if Child:IsA("Tool") then
						Motor6DGrip.Part1 = nil --Simply make it nil when a player unequips a tool.
					end
				end)
			end
		end)
	end)
end)

i tested in studio (and used rig builder for further confirmation) and the PrimaryPart was the head, are you sure you’re not putting it inside the head?

Oh, yeah, definitely not trying to put the motor6d on the head. Also why does it do that?

do what in specific?

Placing the motor6d on the head? Also, mine isn’t appearing for whatever reason, weird.

i tested your script in my own studio and it seems to have put it in the head? i have no idea why it isn’t working for you
image

Idk, it just doesn’t. Any suggestions to fix this?

Oh and by the way, the ToolGrip is actually just a body part from a blender animation rig if that helps

the only thing i can think of is checking the primary part of the character

or try

local Motor6DGrip = Instance.new("Motor6D", Char.HumanoidRootPart)
Motor6DGrip.Part0 = Char.HumanoidRootPart

EDIT: Nvm, apparently I need to move the entire script onto a Viewmodel script for some reason? Fixed it though.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.