How to animate Tool Parts (Guns, Knifes etc.)

Alright so I’m having this weird issue where like, the character isn’t standing still while holding the gun and walking, so it looks pretty weird.

It looks something like this:

It’s weird because like I set the anim priority to action, and I followed all the steps.

I also set the M6D part0 to humanoidrootpart instead of torso, but not sure if that makes a difference since HRP is the R15 equivalent of torso

bind the weapon to the arms then it wont look derp

Did you animate the gun? You have to also animate the gun.

He’s right. Animate the gun since it will only stay still if you don’t.

Apparently, whenever I equip my gun and the animation plays, the arms glitch out for a second and then go back into place. It makes the gun seem unnatural:
Any help?

For some reason, whenever I equip the tool it will just attach it to my character’s body, animate the arms but not the tool, any reason why this could happen?

When i equip my tool, a error shows up and says that ToolGrip is not a valid member of Part, what is happening? thanks in advance!

EDIT

Just add WaitForChild at character.Torso and it will work but my tool DISSAPPEARS lol i dont know why but it deletes itself.

1 Like

Don’t set part0 to HRP, set it to torso or uppertorso, because uppertorso animates with the run, and that makes the gun move with the character animations, otherwise the arms move and the gun doesn’t because HRP can’t be animated

2 Likes

I believe it is because your gun hits the ground when you equip it.

Try making sure all the parts of the gun have CanCollide set to False.

It tells me "attempt to index nil with ‘Torso’ I’ve made sure I’m using R6.

It means that the thing the Torso is inside of doesn’t exist(according to the script)

I have the same issue, have you found a solution?

I have this problem: my tool is teleported back where it was left when it was unequipped. I have only tested from Roblox Studio.
However great tutorial

did you weld the gun to the arm or did you use a motor 6d, if you used a motor 6d it should work.

what is “Connect” suppose to mean? I understand I am suppose to figure it out but I cant get this right.

all of the parts are cancollide off

There’s an issue with installing the plugin. I get

Launch Task InstallPlugin requires valid -assetId

+1 This is a very helpful tutorial, but I have a few things to ask.

Would I have to animate the equipped and unequipped actions for my tool? I was fine with the default one, but now whenever I equip my tool the right arm doesn’t go up as if it was a normal tool.

Now, my tool is stuck in the torso, but I already made sure that the tool is unanchored, not welded, and each line of code is working. I think it may be the hot weather, but I can not figure out what is wrong. How would I position it to be on the right arm?

I wish the tutorial was a little more clear in how the tool is positioned.

fail

Here is the code, which is basically what is seen in the tutorial. (I hope)

Client
-- [[ Services ]] --
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- [[ Tool ]] --
local zapperTool = script.Parent

-- [[ Remotes ]] --
local remoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")
local ConnectMotor6D = remoteEvents:WaitForChild("ConnectMotor6D")
local DisconnectMotor6D = remoteEvents:WaitForChild("DisconnectMotor6D")

-- [[ Player ]] --
local localPlayer = Players.LocalPlayer
local localCharacter = localPlayer.Character or localPlayer.CharacterAdded:wait()
local localHumanoid = localCharacter:WaitForChild("Humanoid")
local mouse = localPlayer:GetMouse()

local toolGrip = localCharacter.Torso:WaitForChild("ToolGrip")
local bodyAttach = zapperTool:WaitForChild("BodyAttach")

-- [[ Animations ]] --
local zapperFire = zapperTool:WaitForChild("ZapperFire")
local zapperFireTrack = localHumanoid:LoadAnimation(zapperFire)

zapperTool.Equipped:Connect(function()	
	ConnectMotor6D:FireServer(bodyAttach)
	
	toolGrip.Part0 = localCharacter.Torso
	toolGrip.Part1 = bodyAttach
end)

zapperTool.Unequipped:Connect(function()
	DisconnectMotor6D:FireServer()
end)

-- Fires onZap to server and changes appearance of zapper
zapperTool.Activated:Connect(function()
	zapperFireTrack.Priority = Enum.AnimationPriority.Action
	zapperFireTrack.Looped = false
	zapperFireTrack:Play()
end)

Summary
-- [[ Services ]] --
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local remoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")
local ConnectMotor6D = remoteEvents:WaitForChild("ConnectMotor6D")
local DisconnectMotor6D = remoteEvents:WaitForChild("DisconnectMotor6D")

Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local motor6D = Instance.new("Motor6D")
		motor6D.Parent = character.Torso
		motor6D.Name = "ToolGrip"
	end)
end)

ConnectMotor6D.OnServerEvent:Connect(function(player,location)
	local character = player.Character or player.CharacterAdded:wait()
	character.Torso.ToolGrip.Part0 = character.Torso
	character.Torso.ToolGrip.Part1 = location
end)

DisconnectMotor6D.OnServerEvent:Connect(function(player)
	player.Character.Torso.ToolGrip.Part1 = nil
end)

Your reply doesn’t help the user at all. If you managed to do it then you may want to explain him how and maybe he could also help you debug.