I'm following a tool animation tutorial; help?

I am currently following this tutorial: How to animate Tool Parts (Guns, Knifes etc.)
But, when I equip my tool, it just goes straight to my UpperTorso and just stays there, when I click, it plays the animation with the tool just sitting in the UpperTorso.
I don’t believe it’s a scripting issue, it might be, any fixes?

Server Side
local torsoPart = "UpperTorso"

game.Players.PlayerAdded:Connect(function(plr)			
	plr.CharacterAdded:Connect(function(char)	
		local M6D = Instance.new("Motor6D", char[torsoPart])
		M6D.Name = "ToolGrip"
	end)
end)

game.ReplicatedStorage.ConnectM6D.OnServerEvent:Connect(function(plr,location)
    local torso = plr.Character[torsoPart]
	local toolGrip = torso["ToolGrip"]
	if location then
    	toolGrip.Part0 = torso
	end
    toolGrip.Part1 = location -- if location is nil, this becomes nil

end)
Client Side
local torsoPart = "UpperTorso"

local WeaponTool = script.Parent

local toolGrip = char:WaitForChild(torsoPart):WaitForChild("ToolGrip")
local bodyAttach = WeaponTool:WaitForChild("BodyAttach")

local function fire(...)
	game.ReplicatedStorage.ConnectM6D:FireServer(...)
end

WeaponTool.Equipped:Connect(function()
	fire(bodyAttach)
	
	toolGrip.Part0 = char.UpperTorso
	toolGrip.Part1 = bodyAttach
end)

WeaponTool.Unequipped:Connect(function()
	fire()
end)

2 Likes

Use this plugin to change the position where your tool is equipped.

1 Like

Yes, but the tool uses Motor6D to use it, as ‘requireHandle’ property is supposed to be set false.

1 Like

That just changes where the tool goes when you equip it. It has nothing to do with the handle or the Motor6D.

1 Like

So basically, I get this error:

Infinite yield possible on 'Workspace.dockboy20006.UpperTorso:WaitForChild(“ToolGrip”)

1 Like

That means there is no child on the upper torso named tool grip.

1 Like

Yes, indeed. Why isn’t there? I put the parent of M6D to char.UpperTorso, and it still isn’t appearing, why is that?

1 Like

I think you should index it under the event.

Still the same error.

local torsoPart = "UpperTorso"

game.ReplicatedStorage.ConnectM6D.OnServerEvent:Connect(function(plr,location)
	local char = plr.Character or plr.CharacterAdded:Wait()
	-- less work and just one remote event needed
	local M6D = Instance.new("Motor6D", char[torsoPart])
	M6D.Name = "ToolGrip"
	
    local torso = plr.Character[torsoPart]
	local toolGrip = torso["ToolGrip"]
	if location then
    	toolGrip.Part0 = torso
	end
    toolGrip.Part1 = location -- if location is nil, this becomes nil

end)

I meant on the client script not on the server script.

Now it’s saying: ToolGrip is not a valid member of MeshPart
But I’m literally checking the UpperTorso and I see ToolGrip inside

Are you sure, you’re using wait for child?

It appears, when we use it on the Client script, it doesn’t replicate to the server.

When creating it try using this.