Tool doesn't connect with player (Moto6D)

Currently i’m trying to make a tool animation with Motor6D.
The Problem is that the Tool doesn’t connect with the player. It just appears on a random place.
I used this tutorials:
How to animate Tool parts
HowToRoblox Video

here are the scripts:

--local script in Tool
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()

local tool = script.Parent


local idleAnim = char:WaitForChild("Humanoid"):LoadAnimation(script.IdleAnim)
local shootAnim = char:WaitForChild("Humanoid"):LoadAnimation(script.ShootAnim)


tool.Equipped:Connect(function()

	game.ReplicatedStorage.ConnectM6D:FireServer(tool.BodyAttach)
	
	char.UpperTorso.ToolGrip.Part0 = char.UpperTorso
	char.UpperTorso.ToolGrip.Part1 = tool.BodyAttach
	
	
	idleAnim:Play()
end)

tool.Unequipped:Connect(function()

	game.ReplicatedStorage.DisconnectM6D:FireServer()
	
	idleAnim:Stop()
end)



tool.Activated:Connect(function()
	
	shootAnim:Play()
end)

--Script in serverscriptservice:
game.Players.PlayerAdded:Connect(function(plr)			
	plr.CharacterAdded:Connect(function(char)
				
		local M6D = Instance.new("Motor6D")
		M6D.Name = "ToolGrip"
		M6D.Parent = char.UpperTorso
    end)
end)

game.ReplicatedStorage.ConnectM6D.OnServerEvent:Connect(function(plr, location)

      local char = plr.Character
      char.UpperTorso.ToolGrip.Part0 = char.UpperTorso
      char.UpperTorso.ToolGrip.Part1 = location
end)

game.ReplicatedStorage.DisconnectM6D.OnServerEvent:Connect(function(plr)
	
    plr.Character.UpperTorso.ToolGrip.Part1 = nil
end)


Here’s the Error I got: ToolGrip is not a valid member of MeshPart “Workspace.smarties1920.UpperTorso”
First I tried to do it like in the video and in the devforum post, but it didn’t worked, so I got the free model from video to find out what I did wrong. But the free model from Video is also not working.
Can Anyone help me find out why it doesn’t works?

2 Likes

use HumanoidRootPart instead UpperTorso

I’m doing it with R15, and R15 has no humanoidrootpart.

it has you can look it r15 and r6 has humanoidrootpart

Oh, sorry I didn’t saw that. Thank you now it works!

and use WaitForChild(“HumanoidRootPart”) sometimes it is can take a while to load character

1 Like

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