Animation of a Tool works fine in the Animator, but not in Game

Right now I’m trying to make a very simple animated tool in roblox studio by following Stacky’s tutorial
How to animate Tool Parts (Guns, Knifes etc.). I believe I followed his guidelines exactly, but for some reason the “Gun” is not moving when I play the animation in game. While in the animator it animates just fine.
In Animator:


In Game:
image

These are the scripts that I’m using (Almost a copy&paste from Stacky’s scripts)

Client Side parented to the gun tool:

local WeaponTool = script.Parent
wait(.5)
local player = game.Players.LocalPlayer
local char = player.Character
local hum = char.Humanoid
local Mouse = player:GetMouse()
local anim = script.Parent.Fire
local animator = hum:WaitForChild("Animator")
local fire = animator:LoadAnimation(anim)
fire.Looped = false
local canFire = false

script.Parent.Equipped:Connect(function()
	game.ReplicatedStorage.ConnectM6D:FireServer(WeaponTool.BodyAttach)
	char.UpperTorso.ToolGrip.Part0 = char.UpperTorso
	char.UpperTorso.ToolGrip.Part1 = WeaponTool.BodyAttach
	canFire = true
end)

WeaponTool.Unequipped:Connect(function()
	game.ReplicatedStorage.DisconnectM6D:FireServer()
	canFire = false
end)

Mouse.Button1Down:Connect(function()
	if canFire == true then
		fire:play()
	end
end)

And this is the server script in ServerScriptService.

game.Players.PlayerAdded:Connect(function(plr)
	print("Player Being Added")
	plr.CharacterAdded:Connect(function(char)		
		local M6D = Instance.new("Motor6D", char.UpperTorso)
		M6D.Parent = char.UpperTorso
		M6D.Name = "ToolGrip"
	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)

I would recommend using the Tool Grip Editor plugin (Tool Grip Editor - Roblox), because it looks like you have the ToolGrip on the UpperTorso, But it should be on the RightLowerArm? I believe unless that’s just something you aren’t doing, which is fine if you aren’t but just an opinion. Looking over this it just looks like the ToolGrip is incorrect.

That was 100% my intent. In the Animator I also had the Motor 6d parented to the UpperTorso as well. My reasoning behind this is based off of Sparky’s statement that it gives more freedom with using both arms for the animation.

Makes sense, I’m not sure why it would be doing this though. If you have access to tool grip mabye you could edit it there and see where it is, the Motor6D may just not have the exact position, But on the Animator is does? I’m not sure how that would work or if in the animator the Motor6D would be temporary. I’m not too sure.

A theory I’ve been nursing is that I somehow didn’t export the animation correctly, so tomorrow I’ll try to redo it.

1 Like

I believe I found the problem. When I animated the model, instead of importing the model into the tool I imported all the parts in it into the tool instead. Not sure why this created a problem in the first place but whatever the reason you must keep the model that you animated intact.

1 Like