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

i get an error message for “WeaponTool” and the motor6d isnt appearing

It keeps falling through the ground do i need a handle for the tool

Try and redo the tutorial to see if you missed anything.

im pretty sure the script is supposed to connect the torso and BodyAttach regardless of any other things i do
are there specific places im supposed to put the scripts other then the tool?

i also found a video version of this with a free model and even after setting up the model nothing changes

Look in the output window and show me it.

This clearly explains what the problem is, it’s trying to find toolgrip in torso, where it doesn’t exist.

thanks i finally got it to work
image
although it stops playing the idle animation to play one of the default animations
it also doesnt play the animation outside of studio

image

Please help

2 Likes

just dont connect a motor6d twice

1 Like

Thanks for the tutorial, but Im still confused on some things. From your screenshots and from looking at your game, theres a lot that you left out while calling yourself a ‘junior developer’(youre too humble, lol). What resources did you learn from? Have you made any more posts on this subject?

1 Like

How did you manage to fix it? I’ve been having the same problem and I still haven’t found a fix.

2 Likes

You need to set the animation to looping. If you don’t, the idle will stop after its finished.

1 Like

The script is set for R6, and he’s using R15.

1 Like

Thanks for the great tutorial!! I really will use this but I do have one question. Since the gun has a Motor6D in it will I be able to move the parts from the Animation Editor??? Also with the stuff like the SMG how did you make the Magazine fall off then appear in the players hand to go back in (and how did you make it go perfectly back in I am not much of an animator) without the player seeing it move up to your hand.

2 Likes

Hi! i have a question, how you did the arms moving in your gun?

(im new at scripting)

1 Like

Since this is highly requested question by @GeneralLPrince, @takticiadam, and you I will answer it. You can make a LocalScript and put it under StarterCharacterScripts.

--!strict

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local Player = Players.LocalPlayer
local Mouse = Player:GetMouse()
local Character = Player.Character or Player.CharacterAdded:Wait()

local Torso = Character:WaitForChild("Torso") :: BasePart
local RightArm = Character:WaitForChild("Right Arm") :: BasePart
local LeftArm = Character:WaitForChild("Left Arm") :: BasePart
local LeftShoulder = Torso:WaitForChild("Left Shoulder") :: Motor6D
local RightShoulder = Torso:WaitForChild("Right Shoulder") :: Motor6D
local Humanoid = Character.Humanoid :: Humanoid

local OffsetMouseYAngle = math.rad(15)

RunService.RenderStepped:Connect(function()
	if Humanoid.Sit then return end
	
	local mouseYAngle = math.asin((Mouse.Hit.Position - Mouse.Origin.Position).Unit.Y) - OffsetMouseYAngle
	
	if LeftShoulder and LeftArm then
		LeftShoulder.C0 = CFrame.new(-1, 0.5, -0.2) * CFrame.Angles(math.rad(70) + mouseYAngle, math.rad(-90), math.rad(52))
	end
	
	if RightShoulder and RightArm then
		RightShoulder.C0 = CFrame.new(1, 0.5, -0.2) * CFrame.Angles(math.rad(120) + mouseYAngle, math.rad(90), math.rad(-104))
	end
end)

This code should be self explanatory. If you want to make it tool only then you will need to do it yourself as a homework since I already shared the complete code :slight_smile:

Please note that this only works for R6 rig.

4 Likes

Damn, I figured it out after 2 months of my post in the hard way but cheers mate. Hopefully it’ll help those who are struggling with it

2 Likes

Thanks! This is very nice for me :slight_smile:

Would this work with accessories by any chance? I’m not a big fan of the tool system ROBLOX uses so I wanted to create my own system for handling tools.