How to make the tool follow the camera with a hold animation? The answer is here!

Hello, today I will show you how to make the tool follow the camera with a hold animation.

1. The first thing you need to do is create a tool!

This is how you should do it
You can put the handle where you want!
You also need to weld the handle with the rest of the parts
For welding you need a plugin - Constraint Editor - Roblox
First select the handle and then all the parts in the FlashlightModel and press new Weld

You can also use the Tool Grip plugin for a proper grip - Tool Grip Editor (Rojo Version) - Roblox (free version)

2. Now you need to make the grip animation!
Create a Dummy

After creating a Dummy, make it an animation!

Also you need to select in Set Animation Priority → Idle

Then you must publish your animation

And copy id

3.Create a local script in the tool
After you have created a local script, you need to write:

local Tool = nil 
local animScript = nil
local Players = game:GetService("Players");
local RunService = game:GetService("RunService");

--- Declarations ---
local Player = Players.LocalPlayer;
local Character = Player.Character or Player.CharacterAdded:Wait();

local Mouse = Player:GetMouse();

--- Character ---
local RightUpperArm = Character:WaitForChild("RightUpperArm");
local RightShoulder = RightUpperArm:WaitForChild("RightShoulder");
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart");
local handler = nil

	Tool = script.Parent
	animScript = Tool.Parent:WaitForChild("Animate")
	animScript.toolnone.ToolNoneAnim.AnimationId = " ANIMATION ID HERE"
	handler = RunService.Stepped:Connect(function()
		-- update direction to camera's look vector
		local direction = game.Workspace.CurrentCamera.CFrame.lookVector * 500;

		-- get the rotation offset (so the arm points correctly depending on your rotation)
		local rootCFrame = HumanoidRootPart.CFrame;
		local rotationOffset = (rootCFrame - rootCFrame.p):inverse();

		-- since CFrames are relative, put the rotationOffset first, and then multiple by the point CFrame, and then multiple by the CFrame.Angles so the arm points in the right direction
		RightShoulder.Transform = rotationOffset *, 0, 0), direction) * CFrame.Angles(math.pi / 2.5, 0, 0);

	if Tool then
		animScript.toolnone.ToolNoneAnim.AnimationId = " ANIMATION ID HERE"

4. Congratulations! You have made your flashlight!
If you have any errors write me and I will help you!
If there is good activity under this post, then I will show how to make a light on click
(My English is bad)


Wow, very useful! But this needs to be moved in #resources:community-tutorials

1 Like

OK, thank you! This is my first post so I might be confused.