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

Also make sure “RequirsHandle” is off, there should be no welds between Right Arm and the tool.

11 Likes

Thank you soo much, was looking for this for ages, well not ages, but I pretty much needed it soo bad, since I would always move the whole arm when I needed the gun to move!
But the thing is that I am more of an builder guy, and don’t know how to script well, so that might stand in my way…

Also, will this work with swords too? What I mean is, my sword is just two parts, BladePart (with the sword mesh in it) and an Handle. Will it work the same way as the gun does?

9 Likes

Yes it will, I’m also using this to animate a sword. Just be sure to rename ‘Handle’ to ‘BodyAttach’.

5 Likes

This is happening

5 Likes

There’s over 1 Motor6Ds is being attached to BodyAttach, check your Motor6Ds.

6 Likes

Woah, I will try and remember this in case if I want to animate with tool parts.

3 Likes

This happened. I probably did something wrong.

8 Likes

There’s probably something wrong with your code, please show me the code/output.

5 Likes

OK, I should be able to show you step by step on how I did it with screen shots. Or the places where I messed up.

7 Likes

I think that it’s HumanoidRootPart that you want instead of upper torso - HRP behaves like R6’s Torso part.

5 Likes

How can this be applied to R15 characters and Using Moonsuite as an animator?

5 Likes

I haven’t explore Moon Suite in detail so far - But I tried to follow the same steps with Moon Suite, I stopped at the animating part and it works fine, not sure does it work after it’s being exported.

5 Likes

The animation is playing, but the tool isn’t playing it’s animations.

This is what it’s showing in the editor:
https://gyazo.com/4e4f375357dac282bee651dc24d67fb9

This is what it’s showing in game:
https://gyazo.com/1e41c30e571f955fb33f8149655af137

Here is the script that plays it:

script.Parent.Equipped:Connect(function()

	attachEvent:FireServer(script.Parent:WaitForChild("48"), "Attach")
	
	character = player.Character or player.CharacterAdded:Wait()
	humanoid = character:WaitForChild("Humanoid")
	if not idleAnim then
		idleAnim = humanoid:LoadAnimation(script:WaitForChild("IdleAnimation"))
	end
	idleAnim.Looped = true
	repeat wait() until character:WaitForChild("ToolGrip").Part1 ~= nil
	idleAnim:Play()
end)

Yes, I know it’s welded to the hand, but I’m not the animator. The animator had welded it to the hand and I’m just doing the scripting.

8 Likes

Make sure no weld is connected to anything? Mind screenshoting the explorer structure?

5 Likes

Why there are dots in the script are those necessary?
Where does the server script go?
https://gyazo.com/5f8766a62a119663443e85d0565b56a0 All this unkown warnings. Dont I have to do something here?

3 Likes

Please, the code above is for reference only. I gave the basic root and the structure of how it should works, but you have to define variables by yourself! Everyone has a different code.

6 Likes

image

Here is the explorer

3 Likes

You have the structure when it’s being equipped? Show as many descendants as you can.
By the way I do not recommend use welds.

Seems that you missed this step, it might not be the root cause of the problem that you’re having, but just a reminder.

3 Likes

The M6D that connects the body and the tool has part0 as the hand and part1 as the handle.

I made all the welds into M6Ds

4 Likes

Just a question. The gun has to already have a firing script to shoot and reload animations inside of it right?

4 Likes