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

Yep! So when the character equips the item, it plays the animation

1 Like

Well it’s assumed in this tutorial you have some basic knowledge of how to play animations but if you don’t;

  • Load the animation track
  • On tool Equipped, play the animation
local Player = game.Players.LocalPlayer
local Humanoid = Player.Character:WaitForChild("Humanoid")

local Tool = script.Parent
local Animation = Instance.new('Animation')
Animation.AnimationId = 'rbxassetid://ID_HERE'
local AnimationTrack = Humanoid:LoadAnimation(Animation)

Tool.Equipped:Connect(function()
    AnimationTrack:Play()
end)

Tool.Unequipped:Connect(function()
    AnimationTrack:Stop()
end)
6 Likes

I tried this process exactly but I seem to have run into an issue. The handle and arms and everything animate but the mag doesn’t. Even in the place file, you included, I am unable to move or rotate the mag in any way in the animation editor.

I tried these things:

  • Remove the welds (Works, but then the mag goes out of place or position and the gun won’t follow the handle)
  • Use a character creator plugin for the mag (still had to remove welds so same issue as above)

Did it work when you first made tutorial 2? Because it doesn’t seem to now. Any ideas?

5 Likes

Thank you for bringing this to my attention. I realize I accidentally included a Weld inside the Magazine. This welded the Magazine to the Handle and prevented it from moving. If you delete the weld this should fix the problem. I’ve updated the place file in the tutorial post to address this problem.

Do I only remove the weld in the mag or for every part? Also does that… oh I just realized mid sentence… You don’t need a weld if you have a motor6d… I really should have thought that through a bit more. lol thanks though.

Does this exact same process work for even more advanced made guns like the one you showed off in your example? Specifically, I’m talking about how you just create a weld between all parts using the welding plugin rather than by a script like I’ve seen done traditionally.

This will work for any tool, yes. The reason welds are added manually during the animating process is so that the gun doesn’t fall apart while you’re animating it. When using the gun in-game you can weld it using a script, does not have to be manual of course.

Thank you for this tutorial! I have struggled with this for months…
:pray:

1 Like

Nice! One of my projects involves the characters interacting with held objects like cups of tea and weapons. Just what I needed!

1 Like

No why would you that? You animate a model at one time.

3 Likes

When I try your above steps, the magazine and bolt get completely misplaced once I set the Part0 and Part1 of the Motor6Ds.

https://gyazo.com/af1c41c880bda638caf398400ba45e34

Step 1. Weld the Mag and Bolt to the Handle.
Step 2. Insert the weapon/tool into the dummy. (My gun is a tool, but I also tried it as a regular model and the same thing occured…)
Step 2. Insert a Motor6D to the right hand of the Dummy and attach Part0 to the hand and Part1 to the Handle.
Step 3. Insert a Motor6D to the Handle named ‘Mag’ and set Part0 to the handle and Part1 to the Mag.
Step 4. Repeat step 3 for the Bolt instead of the Mag.
Step 5. Delete the welds in the Bolt and Mag. (At this point the mag and bolt instantly move several studs away from where they should be. I am not interested in just using the animation to correct the position, because that is not desirable behavior at all. Please help!

(I tried skipping the weld step since it shouldn’t be necessary for the mag and bolt and just went straight to the motor6d step and the same thing happened. I have no idea why this is happening.

1 Like

Are you able to link me a repro file? I can’t help much without taking a look at it myself.

I wasn’t setting the C0 or C1, thanks though! I am now using the Character Creator plugin to create the Motor6Ds.

Why does the specific part moved when I attach the Motor6D to handle and the specific part?

Edit: This can be solved by using a plugin.

1 Like

Try welding the Pump to the Handle like all the other parts, creating the Motor6D, and then deleting the weld after. This should in theory prevent it from moving.

2 Likes

I solved it, your tutorial is definitely useful, however I think it will be move convenient to use the Custom Character Creator Plugin. I deleted the weld inside the part that I wish to animate and it works.
Also for some reasons there’s no weld/Motor6D inside the part that I wish to animate, but it still works as intended.

I tried it but it still moved few studs away, I have no idea why. But this doesn’t happen if I use the Custom Character Creator Plugin, I manually created these Motor6D. I can not use the plugin because there are too many parts in the tool and I can not select all of them with the plugin :frowning:

Please help! Much appreciated!

1 Like

Can you send me a repro file with that weapon and dummy rig in the gif? I’ll be able to look into it better that way.

Sent you through private message.

But I ran into another problem, for an example, I wanted to animate an gun inspecting animation. I have to rotate and move the gun’s handle:

In Editor:

But when I play it in game, it’s not rotating/moving? There are no welds inside the shotgun, but only Motor6D inside the handle.

Another example: A reload animation that moves RightArm, if I move the RightArm, the tool will also move because it’s binded to RightArm. So I moved the tool during the reload. However in game, it doesn’t move.

In Editor:

In Game:

How do I solve this? Because I want to freely move the tool and it’s part around for different cool animations.

3 Likes

This is definitely unusual, and this behaviour was not encountered when I was creating this tutorial. I’ll do some further investigation and see if it was a recent update that caused the problem, and see if I can find any workarounds.

2 Likes