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

Can you try with your own gun (the GIF you posted above) and see can you freely rotate and move the weapon’s handle when animating? Like an inspecting animation.

The problem might be that roblox welds the tools handle and the players right arm/hand. The weld is stopping the player from moving the tools handle.

This might be a bug with R6, seeing as in @H_mzah’s example, it works fine.

Try making an invisible handle, and connect it with the fake handle with a Motor6D.

I’m not super good with constraints or animation, so this might not work.

There are no welds in shotgun, but somehow eventually I got it fix by reanimating it, but it still performs inaccurate and poor.

Right now I’m trying to weld the weapon to Torso instead of RightArm, just like other body part does. Not sure is it going to work.

Edit: This is so weird… :man_facepalming:
I created a small part like a tool’s handle called BodyAttach. First I connect torso and handle by Motor6D by using plugin, then I connect BodyAttach to Handle, and I connect the rest of the parts in tool to BodyAttach by using Motor6D. Here’s the result in AnimationEditor:
https://gyazo.com/8d77e7e30959872cf6cdb1004906dd1c

However, it’s still weird when I load it…
https://gyazo.com/02ae1593b01fa46c3a4bf8a8b0efb279

2 Likes

As I said, Roblox automatically welds the handle and Right Arm/Hand. It doesn’t matter if you have no welds or not, Roblox does it to make sure your tool stays at your hand.

3 Likes

I was investigating this issue in Roblox Studio for over an hour for now and right now I just found of because of this…

Is there any way to resolve this issue? :frowning:

I don’t want to make my custom tool engine (because I tried before and I feel like using a built-in tool engine is more reliable)
For the dummy that I use to animate, there’s a Motor6D inside the dummy’s torso that are connected to the handle, but when I try creating a motor6D connecting player’s character torso and the handle, the entire tool moves few studs away. This does not happen when I use the custom character creator plugin.

Try making an invisible handle, and connect it with the fake handle with a Motor6D.
Of course, you would have to reanimate it again, sadly. I’d say its worth a try.

I don’t understand, can you simply demonstrate it? What is connect it with a fake handle?

1 Like

I can’t do it in studio currently and provide screenshots, so I will try to walk you through it.

First, Rename your current Handle to “FakeHandle”

Next, make a part. It can be any size, and any shape. Make sure its parented to the Shotgun. Also, turn off anchored and CanCollide.

Rename the part to “Handle”

Next, create a Motor6D, and connect the FakeHandle with Handle.

Then, Reanimate it to work with the fake handle, and it should hopefully work!

1 Like

Good catch @mistrustfully; I’d suggest removing the weld created in the right hand when the tool is equipped and replacing it with your Motor6D, doing this will prevent the hand from being welded.

I think that’s what I exactly did with this?

Torso’s Motor6D is attached to Handle, BodyAttach’s Motor6D is attached to all parts in the weapon including Handle.
I thought it will work but sadly it doesn’t.

Here’s a repro file and hope you will take a look on it, there’s also a tool in StarterPack:
ShotgunReproFile.rbxl (138.6 KB)
image

2 Likes

I finally sort of fixed this! Wrote few lines of code and it works as intended :smiley:
https://gyazo.com/f66d0b6a5fbe67284d9cf03f9a793639

script.Parent.Equipped:Connect(function()

local m6d = Instance.new("Motor6D",char.Torso)
m6d.Name = "ToolGrip"
m6d.Part0 = char.Torso
m6d.Part1 = char.Shotgun.BodyAttach
m6d.C1 = CFrame.new(-1.8,1.5,-0.2)
char:WaitForChild("Right Arm"):WaitForChild("RightGrip"):Remove()
equipanim:Play()

end)

But here comes another problem, how do I do this on the server? There will be a huge lag and delay on the server if I use a RemoteEvent. Currently it only works on client but it doesn’t show up in server.
image

4 Likes

This is the only way to replicate changes to the server in this case, why does it cause huge lag and delay?

I mean… not an exactly huge lag, but I don’t wish there’s a delay. Is there possible way to replicate or simulate the behavior like the Roblox Tool does? Users when lagging with high ping will have heavy issues on equipping.

1 Like

Create a script in your tool for handling the Motor6Ds, and the RightGrip as well. Things done on the server automatically replicate to the client, unless in special containers (Server Storage, Server Script Service, ect.)
The client should be handling the animations, though.

1 Like

Script works in a tool? Never knew that though.
I made my own way to simulate this behavior but it may seems “wacky”, first I called the server to create a Motor6D, then I create another Motor6D on the client. When the server Motor6D is being created, the client on will be voided.

rp.ConnectM6D:FireServer(ShotgunTool.BodyAttach)
	
local m6d = Instance.new("Motor6D",char.Torso)
m6d.Name = "ToolGripCLIENT"
m6d.Part0 = char.Torso
m6d.Part1 = ShotgunTool.BodyAttach
m6d.C1 = CFrame.new(-1.8,1.5,-0.2)


repeat wait() until char.Torso:FindFirstChild("ToolGripSERVER")
m6d:Destroy()

Yeah, this looks wacky and ridiculous but I think it works, I might reference your scenario if this way is inconsistent in different occasions.

1 Like

All scripts run if they are in the workspace, so yes, they work in tools

@H_mzah @mistrustfully I think I kinda fully solved this!
(@/H_mzah you might wish to add the following to this tutorial:)

Edit: Check out this walk-through guide:

A tool’s handle can not be animated, it would not play in game if you tried to animate it. If you wish to move your tool’s handle freely for animations like knife tricks (CS:GO knife admiring animations, etc.), you should do the following.

First, put your tool inside an animating dummy, rename your tool’s handle to something else but not Handle. For some reasons the Motor6D will offset few studs if it’s called Handle no idea why, probably because of Roblox’s tool. I called it BodyAttach.

Secondly, use the Custom Character Creator Plugin, select the dummy model and select “bind” in the plugin, it will require you to select two parts to bind with, select the torso and BodyAttach.

Thirdly, bind BodyAttach with other remaining parts on your tool, for some reasons you must use the plugin to create the Motor6D, do not attempt to create the motor6D by yourself, or else parts will go offset even though there are welds and can not be reverted to it’s original position by pressing undo.

Fourthly, after binding all parts, you are ready to animate! Open the animation editor and you will see Left Arm, Right Arm, Left Leg, Right Leg and BodyAttach, you can now freely animate your tool, including it’s handle!

Lastly, copy the tool you just animated (the one that was inside the animating dummy) and put in StarterPack, all of the Motor6Ds inside BodyAttachshould stay constant and make sure they exist when you run the game. What you want to do now is create a Motor6D when the tool is equipped, the Motor6D’s Part0 should be Torso and Part1 should be BodyAttach. Make sure this have to be done in the server! you can reference the script above.

And here’s how you create a tool without a handle, also how to freely animate a tool’s handle! If you have any questions feel free to mention me. :slight_smile:

26 Likes

Basically, I tried doing that, and instead of the gun being positioned correctly, it was immediately mispositioned.

Any thoughts on how I can fix it?

2 Likes

I’d start of by checking and fixing the handles. Sometimes the handle works differently in studio and in-game.

What exactly do you mean with checking the handle?