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.

5 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?

4 Likes

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

2 Likes

This is happening

3 Likes

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

4 Likes

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

1 Like

This happened. I probably did something wrong.

5 Likes

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

1 Like

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.

2 Likes

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

2 Likes

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

2 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.

3 Likes

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

This is what it’s showing in the editor:

This is what it’s showing in game:

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.

5 Likes

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

2 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?

1 Like

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.

1 Like

image

Here is the explorer

1 Like

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.

1 Like

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

1 Like

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

2 Likes