How to animate a tool/object with a Dummy in the Animation Editor

animations
animation-editor
#1

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 and CanCollide 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.
  • 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

image

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

image

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:
IMAGE

Next we’re going to drag and drop our tool’s Model into the Dummy Model. It should look like this:

IMAGE

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 existing RightWrist one)
    Rename it to HandleMotor6D
  • Go into the properties of HandleMotor6D:
    • Set it’s Part0 to RightHand
    • Set it’s Part1 to the Handle part which is inside the Weapon

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 type Instance.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 to Right Arm
    • Set it’s Part1 to the Handle part which is inside the Weapon

Here’s what your setup should look like right now, the red arrows indicate where I got the Part0 and Part1 from.

IMAGE


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.


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.

85 Likes
Help with attaching sword to character with Motor6D
How to animate mesh part on a gun?
How to rig a weapon in animation editor?
Animating a tool problem
#2

Liked, bookmarked, and shared. Exactly what I need, thank you so much!

7 Likes
#3

Great tutorial - I know a lot of people that will benefit from this :grinning:

1 Like
#4

This is a really well written post. Thanks for making this!

2 Likes
#5

Really like it! Thanks!

1 Like
#6

Great tutorial. It’ll help me a lot with learning how to animate with gears!

1 Like
#7

I have a question, would playing this animation actually use the tool? Such as rotating the handle to the right, would this duplicate to a real tool, if you were using one?

#8

Yes, as long as the motor6d’s part0/1 are set to the correct parts, you can parent the handle to anything (even a tool) in the character and it will still work

2 Likes
#9

Awesome. I figured this would be the case because the animation editor listed only picked up the handle. I tend to manually move the arms for guns, or whatever else I need to make. It’s not a good solution however I never knew how to integrate animations with tools.

1 Like
#10

This might just save me some time! Before, I’ve used a somewhat hacky method of this process which involved a welding script and the command bar.

1 Like
#11

You don’t need to parent the Handle anywhere. When the tool is equipped you can change the default tool weld in the RightHand to a Motor6D instead, and set the Part0 to RightArm and Part1 to Handle (of the gun). This will allow any animation involving the gun itself to play.


Would you guys like me to make a tutorial on how to animate specific parts of tools/weapons?

(For example this Magazine pulling out)

  • Yes
  • Not needed

0 voters

1 Like
#12

Oh hey, you’ve gotten a lot more into this now. Glad I could help you with getting started!

2 Likes
#13

Can you swap out the gun model but keep the animation? What if you use a model that doesn’t have a gun with this animation?

#14

I don’t get what you mean by this - you mean remove the gun model and animate the character without it?

The above file doesn’t have an animation I’m pretty sure - if it does - oops. If you play this animation on a player/model that is not holding a gun with a Motor6D in the handle it will just play the animation as if the gun was never there.

#15

For instance, I make an animation with this rig while it holds a pistol. I now want to use the same base model and animation but with a squirtgun does the animation still work? The motor6d connection to the original pistol would be gone

#16

Yes if you set it up correctly by following the steps outlined in the main post.

1 Like
#17

Part Two: How to animate specific parts of the weapon/tool

This is part two of this tutorial, and here I’ll be showing you step by step how you can animate multiple parts of your weapon/tool if you wish. This could be useful for things like pulling the chargeback handle on a gun after reloading it, or for manipulating smaller details on your tool.


I will be assuming in this part that you have followed the tutorial in the main post and are up until the point of having the gun rigged to the dummy and ready to go. If you haven’t seen already, here is the file of the point you should be at: AnimationTutorial.rbxl (23.0 KB)

Without further ado let’s get started. We’ll be animating the Magazine of the gun.

Step 1

  • Create a Motor6D in the Handle of the gun and call it ‘Mag’
    image

Step 2

  • Set the Part0 of the ‘Mag’ Motor6D to the Handle
  • Set the Part1 to the gun’s Magazine
    image

That’s it.

Now you should be able to animate the Magazine of the gun in the Animation Editor:


You can replicate these steps exactly for any amount of parts for the weapon or the tool you’re animating.

Here’s the file of progress up until this point.
AnimationTutorialPart2.rbxl (22.1 KB)

Good Luck!

2 Likes
split this topic #18

A post was merged into an existing topic: Off-topic and bump posts

#19

Now, how do we put t into a script, so the player does this in game?

#20

If I’m understanding correctly, you have created an Animation and would like to play it in-game?