I have wanted to make a tool that is animated when you click with it equipped, it could be a gun mag animation or anything else, I just need to animate the tool. I have basic rigging experience but I don’t know how I would rig a tool. I have looked at several different answers in the developer forum and tried them all, but none seemed to work. I might have gotten something wrong, but I have wanted to do this for a while and it would be great if someone could help. I already have a script to animate the character when they click with a tool, but I don’t know how to do it with the tool.
EDIT: this is not just about rigging, this is also about the script.As stated earlier in this text I have looked at scripts that people claim to work, but none work in my favor.
My response is the exact same as @AdjacentPhoenix however I believe I can provide more detail, That being said if this works for you give the solution checkmark to him.
Found this when I was asking the same question. A good read and is exactly what you’re looking for.
I have copied the exact scripts, and followed the instructions no matter what, though it wont work at all. I have actually tried the same script a few times but every try never works.
I’ll help you out with the actual creating the Motors so you can animate them, you can use this for the tool as well
Run in CMD Bar
Replace;
TOOLHERE with the ToolName in Workspace
HANDLEHERE with the name of the Handle
local Tool = workspace.TOOLHERE
Tool = Tool:Clone()
local Handle = Tool.HANDLEHERE
local Weld = function(Part0, Part1)
local C0 = C0 or Part0.CFrame:toObjectSpace(CF(Part0.Position))
local C1 = C1 or Part1.CFrame:toObjectSpace(CF(Part0.Position))
local WeldMotor = Instance.new("Motor6D")
WeldMotor.Part0 = Part0
WeldMotor.Part1 = Part1
WeldMotor.C0 = C0
WeldMotor.C1 = C1
WeldMotor.Name = Part0.Name
WeldMotor.Parent = Part0
return WeldMotor
end
local NewFolder = Instance.new("Folder")
for Index, Des in pairs(Tool:GetDescendants()) do
if Des:IsA("BasePart") and Des ~= Handle then
Weld(Handle, Des)
Des.Anchored = false
Des.CanCollide = false
end
end
table.foreach(Tool:GetChildren, function(Index, Child)
Child.Parent = NewFolder
end)
NewFolder.Name = Tool.Name
Tool:Destroy()
NewFolder.Parent = workspace
Once you run that, put the folder in the animation rig. Then create a Motor6D in the right or left hand and set Part0 to the hand and Part1 as the Handle of the Tool.
After you have correctly done the above, you can now animate every part of your tool!
I have no idea why, but for some reason I cannot use the command bar. I have enabled Command Bar and Output and no matter what I will do it will not appear. I will try and put it into a script though.