Tool Animation Help

So i have a gun that i made in my game and i wanna make an animation for it that when the player clicks the mousebutton1 an animation plays

I have no clue on it , how would i go on making it
This gif explains it better on what im trying to say
giphy

Any help is appreciated
Thanks

Animating tools is pretty tricky because they don’t really natively support that to my knowledge, unless you forcefully edit the grip CFrame values. If you want a more reliable solution that depends on the engine, you could attach the gun with a Motor6D and then, on a rig with the gun attached in the same way, animate it alongside your character.

Edit: Consider the reply under mine if you do not want the gun model to move, and just want it to be rotated properly when attached.

This is almost definitely not the correct way to do this. I typically make the animation and then use the Tool Grip Editor plugin by CloneTrooper1019 to edit the orientation of the gun until it looks correct. Just make sure the gun is welded properly

1 Like

what u would want to do is load (and play) an animation when the player activates the tool. this can easily be done on the client side!

-- pretty basic, but it's only meant to serve as an example 
-- no need for remote events, client-side animations replicate automatically
local Players = game:GetService("Players")

--\\ tool & weapon setup
local weapon = script.Parent
local animAssetId = `119021135878993`-- replace with your own id

local function triggerAnimation(plr)
	local char = plr.Character
	local humanoid = char and char:FindFirstChild("Humanoid")

	if humanoid then
		local newAnimation = Instance.new("Animation")
		newAnimation.AnimationId = (`rbxassetid://{animAssetId}`)

		local animTrack = humanoid:LoadAnimation(newAnimation)
		animTrack.Priority = Enum.AnimationPriority.Action
		animTrack:Play()
	end
end

--\\ play animation when player uses the tool
weapon.Activated:Connect(function()
	local user = Players:GetPlayerFromCharacter(weapon.Parent)
	if user then
		triggerAnimation(user)
	end
end)

thanks it worked :smiley:
i appreciate the help

one question how do i stop the animation when the weapon is reloading

i’m pretty sure there’s a “Stop” method (animTrack:Stop())

Thanks so much man
It worked out