Hey everyone, I’ve answered the question about how to animate a tool, such as a weapon alongside a rig/dummy a few times now and I thought it would be useful for the some members in the community if I made a tutorial about it.
First things first, you’ll need to pick out the object you’re animating along with your Dummy. For this example I’ll be using a very simple ‘Gun’, and an R15 rig, however you can follow similar steps for R6 which I will add below.
Before you begin:
You should download this plugin before proceeding to make things way easier in this tutorial.
This is the gun I will be using, if you use this you might find it easier to follow along:
Weapon.rbxm (2.5 KB)
Let’s get started. Firstly, we’re going to prepare our tool.
If you’re using the Weapon I attached above, you can skip these steps, but be sure to read them regardless.
- Create a part called ‘Handle’ in your Tool
- Set the
Transparency
to 1 andCanCollide
to false
Position it where you’d like the tool to be held from. This part will act as the ‘Primary’ part of the tool and everything will be linked to it.
- Set the
- Take the gun and unanchor all of the parts.
- Group all of your parts. At this point you should have a Model with a part called ‘Handle’ inside of it. The rest of the parts don’t matter, you can have as many as you want.
Current Progress
Now, we’re going to Weld the parts together so that they don’t fall apart when we’re trying to animate.
Method: Using the plugin:
Instructions
- Click the Handle part first, and then CTRL + Click the rest of the parts and press this button on the Plugin tab:
This will now weld all of the parts in the model to the Handle part. You should get something like this. Note that the Handle itself should not contain any welds.
CURRENT PROGRESS
Next, we’ll begin rigging our weapon up to the Dummy. Here’s how:
- If you haven’t already, you should Insert an R15 Block Dummy, easy way to do this is by using the Rig Builder plugin:
Next we’re going to drag and drop our tool’s Model into the Dummy Model. It should look like this:
Now we’re going to attach the Handle
of the Weapon to the RightHand
of the rig, like so:
- Insert a Motor6D into the
RightHand
of the Dummy. (Or you can duplicate the existingRightWrist
one)
Rename it toHandleMotor6D
- Go into the properties of
HandleMotor6D
:- Set it’s
Part0
toRightHand
- Set it’s
Part1
to theHandle
part which is inside the Weapon
- Set it’s
If you’re using R6 follow the instructions below for this step:
R6 INSTRUCTIONS
- Insert a Motor6D into the
Right Arm
of the Dummy. (You can typeInstance.new('Motor6D', workspace')
into the command bar to create a Motor6D.`)
Rename it to HandleMotor6D
- Go into the properties of
HandleMotor6D
:- Set it’s
Part0
toRight Arm
- Set it’s
Part1
to theHandle
part which is inside the Weapon
- Set it’s
Here’s what your setup should look like right now, the red arrows indicate where I got the Part0 and Part1 from.
If all of the above steps were followed correctly, congratulations! You’re ready to start animating. Your dummy should somewhat be ‘holding’ the tool now. If you’re using the Gun I attached at the beginning of this tutorial, your Dummy should look something like this:
You should also see the Handle under ‘RightArm’ inside the Animation Editor.
You can now move/rotate the Handle, which will move/rotate the whole gun.
Here’s an example of what you can do with this tutorial (and the second part of it marked the solution).
https://gyazo.com/ab7258a2123fce65c3011a45d7e788b3
This tutorial may look complicated at first, but don’t be put off by it! Once you get the hang of doing this, it will become a second nature and will be quite easy to do very quickly.
Here is a .rbxl of what you should have at the end of this tutorial. You can use this to see how things are set up if you’re confused.
AnimationTutorial.rbxl (23.0 KB)
Good luck!
Thank you @helloguys34 for introducing me to this concept.