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

Hello everybody! I saw a lot of comments saying that the script to make the gun go to the players torso isnt working. Here is an updated script I made!

script.Parent.Equipped:Connect(function()
	local plr = game.Players.LocalPlayer
	local char = plr.Character or plr.CharacterAdded:Wait()
	
	local motor6d = Instance.new("Motor6D")
	motor6d.Parent = char:WaitForChild("Torso")
	motor6d.Name = "ToolAttach"
	
	motor6d.Part0 = char:WaitForChild("Torso")
	motor6d.Part1 = script.Parent:WaitForChild("BodyAttach")
	script.Parent.Unequipped:Connect(function()
		motor6d:Destroy()
	end)
end)

Hope this helps!

Name your bodyAttach to “Body Attach”. Everything should work fine

i can help you with that.

script.Parent.Equipped:Connect(function()
	local plr = game.Players.LocalPlayer
	local char = plr.Character or plr.CharacterAdded:Wait()
	
	local motor6d = Instance.new("Motor6D")
	motor6d.Parent = char:WaitForChild("Torso")
	motor6d.Name = "ToolAttach"
	
	motor6d.Part0 = char:WaitForChild("Torso")
	motor6d.Part1 = script.Parent:WaitForChild("BodyAttach")

	script.Parent.Unequipped:Connect(function()
		motor6d:Destroy()
	end)
end)
2 Likes

Currently having this issue, idle animation is made inside blender and the Motor6D is connectedto the torso but in blender it is connected to the Right Arm but if i change from torso to right arm the gun go into the middle of the arm and not where it is positioned inside blender

If anyone has a problem where their gun in unattached to the player, try editing the server script so that it ALSO connects the torso as Part0

1 Like

Can this even work for FE Gun Kit? I don’t know if it can be able to play the animation even if there is no Handle, or the main animated block(the one that animates all of the parts).

Almost all FPS games don’t actually spawn a new magazine
They just make the “old” one fall out of view and teleport it into the player’s hand where they then just slap the same magazine into the gun

I have the same problem
I’m using R15 (of course) and my knife isn’t swinging around the thumb like in the animation editor
When I play the game I get no errors and the animation plays on the character but the knife doesn’t swing around

EDIT: I fixed it by removing the RightGrip Weld from the RightHand whenever you equip the tool so that the tool is free to play the animations instead of being welded
If you want to watch

Awesome resource, question though, how would you make it so 3rd person animations made using this method, can translate to a first person viewmodel? Essentially I want to be able to use the exact same 3rd person anims, without having to recreate them for first person viewmodel. Currently I can’t figure out how to replicate the player’s arms perfectly.

Idle animations worked for my tool using this method, but with the hit animation, it also worked but the BodyAttach did not rotate or move like I moved it in the animator. How do I fix that?

I followed everything in the tutorial.

never mind it was because the animation priority was not high enough

Overall so far I have gotten the animations to work themselves quite well, but I am a horrible lua scripter so I cant make weapons function all that well. I have gotten the animations to work with the weapon and make them play correctly however.

Not sure if you solved your issue or not, but it honestly looks like a issue that i went through initially with the scripted welding to character. Perhaps you are making the unweld effect all users using that specifc weapon?

I’m having a problem where if a character switches weapons his character stops for a few seconds. It is not caused by any script.

Any know how to animate the running with the tool equipped?

The different animation priorities

has anyone gotten this to work with other torsos like man or boy torso and not just the default r15 torso?

I’ve used this page many times to animate tools, and its really fun and cool but, just today as I was animating a weapon, for some reason the tool/gun could be animated fine using animation editer but wouldnt play in game and just instead spam Failed To Load Animation Id - Sanitized id errors, How can I fix it?
Heres some images to help
huh 3



and heres my code

script.Parent.Equipped:Connect(function()
if script.Parent.GripLol:FindFirstChild(“ToolGrip”) then
else
local weld = Instance.new(“Motor6D”,script.Parent.GripLol)
weld.Name = “ToolGrip”
weld.Part1 = script.Parent.GripLol
weld.Part0 = script.Parent.Parent.RightHand
weld.C0 = script.Parent.Value.Value
end
end)

1 Like

Oh and, the “GripLol” part is the body attach part

1 Like

How did you even make the animations so good?

I’m having the same problem, no errors but when I equip the tool it’s in the workspace. Are we meant to manually set it’s position to the player’s hand? (I’m pretty new to tool stuff)