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

Hello everybody! I’m Headstackk, I’ve been creating and making weapons on Roblox for a while. Today I’m going to teach you how to animate a weapon tool.

I have already briefly explain how on this DevForum post, but I’d like to make a new post to clarify everything and explain it step by step.

In most of the Roblox Shooter games (Excluding advanced shooter games such as Phantom Forces), I observed that they usually make a really simple animation, not even detached magazine, or moving bolt. In this tutorial, I’m going to teach you how to animate those details.
If you would like to make a really detailed gun in terms of Animations and details, be sure to follow this tutorial!

In the end of this tutorial, you should be able to create something like this:

So, let’s begin! :grinning:
I will use a M16 Assult Rifle that I built as an example this time.

1: Create an animating Dummy:

2: Group your gun model, and put it inside the dummy. Your gun model should be parented to the Dummy.

3: Create a new part, name it BodyAttach and place it at wherever you want to, I recommend you to put it near the Gun Handle.
Do Not name the part as Handle.

Inside, you can put cosmetics such as Gun Sounds, Flash Light etc.

4: Connect all the parts of your guns to BodyAttach with Motor6D.
Before we proceed, you have to install this plugin
It’s a must have plugin when it comes to Motor6Ds and Weld.

After installing it, you will need it to connect all the parts.
Please be sure that all the parts are unanchored and there are no welds.

First, select the BodyAttach part first, then select the rest.
After selecting all the parts, click “New Motor6D” in the plugin tab.

And that’s it! You connect all the parts in your gun with Motor6D, they will now stick together.
But before animating, we have to stick the Motor6D to the Animating Dummy!

5: Connecting the dummy to the gun:
For this step, we do not need to use the plugin. Instead, manually create a new Motor6D, you can create one by typing the command in the output bar:
image
Make sure that the Command Bar is on.
image

Then, put the Motor6D into the Dummy’s Torso.

After that, Connect the Motor6D’s Part0 as the dummy’s Torso, and connect it’s Part1 to the BodyAttach of your gun. Make sure your gun is NOT ANCHORED when doing this!
image

Last but not least, WOAH! You will realize your gun moved. Don’t worry, that’s an expected behavior. DO NOT move or rotate your gun after this step, or else the Motor6D will be disconnected!

image

6: Finally! You can start animating!
Open the Roblox Animation Editor, then you can start animating!

You might find something different, when you move the Right Arm, the Gun doesn’t move. This is because your weapon is connected to the Torso instead of Right Arm, like a legacy Roblox tool does.

Benefits of this:
The advantage of connecting to Torso instead of Right Arm is you can animate the gun freely instead of sticking to the Right Arm all the time.

Examples:
LMG reloads:

Reloading with right arm

Lever weapons:

And more! You can also animate knife tricks animation with this, without the knife being stick to the Right Arm all the time.

However, in this tutorial, I’m not going to teach how to animate the gun since I’m also a Junior animator, but that’s how you animate details of a gun!

7: Essential part: In game

You will find this not working in game if you just put it as a typical tool, there are few steps to do before you put it into the game, which requires some scripting.

While animating it, the dummy’s torso is attached to BodyAttach, so does a player character do! You have to create a Motor6D to connect Player’s Character’s Torso manually when tool is being equipped, and destroy it when tool is being unequipped. This has to be done in Server, but you can perform it on Client first before the server for better visual effects.

Remember to implement a RemoteEvent in ReplicatedStorage. I name the Connect M6D and Disonnect M6D RemoteEvent ConnectM6D and DisconnectM6D respectively.
I also create the Motor6D inside the Torso when CharacterAdded.

Client script inside the gun tool:

script.Parent.Equipped:Connect(function()

	game.ReplicatedStorage.ConnectM6D:FireServer(WeaponTool.BodyAttach)
	
	char.Torso.ToolGrip.Part0 = char.Torso
	char.Torso.ToolGrip.Part1 = WeaponTool.BodyAttach

end)

WeaponTool.Unequipped:Connect(function()

	game.ReplicatedStorage.DisconnectM6D:FireServer()

end)

Server Script:

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

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

      local char = plr.Character
      char.Torso.ToolGrip.Part0 = char.Torso
      char.Torso.ToolGrip.Part1 = location


end)

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

LAST, LAST BUT NOT LEAST! Remember to DISABLE RequireHandle in the tool!
image

That’s all about it! If you have any problem, feel free to reply and I’ll be glad to assist you
My aplogies for such a rushed tutorial, I might add more information when necessary. :slight_smile:
Happy animating guns… I guess?

Here’s the completed animation of the M16!

EDIT: IMPORTANT NOTICE:
Apparently, your part can not be named as “MeshPart”. This will happen if you attempt to:

You won’t able to animate that part if it’s name is “MeshPart” with the Default Roblox Animator. No idea why it happens.

This took me 30 minutes find out why I can’t animate it :expressionless:

284 Likes

Thanks! This is very useful and it’s explained very well, I might start animating guns soon!

15 Likes

Very well taught tutorial, i might even consider moving back to animating again! :smile:

7 Likes

Will this worked with lightsaber as well?

7 Likes

Any model i think, all you’ll have to do is follow the steps in this guide but do it for what you desire to animate.

3 Likes

Yeah but the script kinda make me confused it not worked in studio when I test it.

5 Likes

The script is for reference only! It’s a part of my code and you have to set up variables and instances by yourself.

9 Likes

I can’t select the gun while animating with the default ROBLOX anim editor. Any help?

3 Likes

Really good tutorial! Although, i just have a question. Does this work with R15 too?

2 Likes

It should work with R15, just use UpperTorso instead of Torso.

7 Likes

It says that ToolGrip is not a valid member of part, still doesn’t work even though if I add a :WaitForChild. Do you know what to do? I can send you my full script that I added variables to, if necessary.

1 Like

I fixed the issue, but now it won’t even play the animation when I try to equip it.

Here’s what it looks like in the game: https://gyazo.com/8fa67950b50682c508bd362cd6b7b6f7

Here’s what it looks like in animator: https://gyazo.com/e4e54bbc8793978e47ab69be2ba7d5f9

What it looks like on a regular tool: https://gyazo.com/1df5cde578ac41cf89e4e152cbaa7562 (just to prove that the animation actually works)

If anyone could add me on Discord to help me resolve this minor issue, please add me: stick pepega#1603

1 Like

Never mind, I figured it out. It seems like you can only play the animation through a local script.

Thanks for this, I’ll definitely try this out, however I only know the simplest of scripting so I might have problems with that part of it.

3 Likes

You wanna know what would be REALLY nice? A video tutorial, following this step by step. My small brain hurts when I try to follow this as how it is. I think it’d help others (including myself).

My brain hurts. Send help. No, I did not manage to get what I wanted (to animate my tools with motor6Ds.)

5 Likes

Please if you don’t mind is there any possible way that you can provide a very basic example model/file of this?
You see I learn faster by looking at models.

3 Likes

Help, it doesn’t seem to work for me, I want to make a Idle animation for my gun. I followed every instruction you did, but it didn’t quite work for me so I made it so it waits for the motor 6d to be made. It seemed to work but now this happens :
s

and this is what it’s supposed to look like
s

It’s my first time animating a Gun. I also put the priority to Idle. I have no idea what’s happening. What I saw is: Normally when you spawn, your character has a idle animation it kinda breathes. But when I equip the gun , it stops the idle animation. I don’t know what may be the problem, someone please help. Thank you

You need to set your priority higher, ‘Idle’ is overridden by the tool’s default holding animation. It’s safe to put custom idle animations as ‘action’ priority, it will still be overridden by any ‘actions’ you play next.

3 Likes

Thank you, I solved it today already. I was very confused why this was happening.

I’ve been using that weld plugin ever since I originally saw this post. Super helpful man. Grateful to have had this in my time of stupidity.