Make a certain tool not play the roblox holding animation

I have been trying to find out on how I can make only certain tools not play the Roblox Tool hold animation at all, while the others do play. I try overlapping animations, but it always for a split second goes to the Roblox Hold, then plays my animation. It looks non clean, and I wish to fix that.

Is there any forums on this? I really need help.

Example:

Speed coil = Plays the roblox Hold animation.
Bat = Has it’s own animation and the Hold Animation never plays, not even for a second.

A simple way to disable Roblox’s default handle animation is to uncheck the “RequiresHandle” box inside of the tool property. There, you can just weld the tool to the player’s hand.

How can I weld it to the players hand?

1 Like

Here’s some scrap code I found that you can use to weld the tool to the player’s hand:

local Motor6D = Instance.new("Motor6D")
Motor6D.Parent = Character
Motor6D.Part0 = Character:FindFirstChild("Right Arm") -- Set this to the part you want the tool to attach to
Motor6D.Part1 = Part -- Set this to your main part in the tool (like the original handle)
Motor6D.C1 = CFrame.new(Vector3.new(0, 1, 0)) -- This just attaches it to the player's hand, nothing to change here
1 Like

How would I put it into a Equip function? If it’s equipped, the motor6 will work, and if unequipped, the motor6 gets removed?

You can connect a handler to process all playing AnimationTracks in the Animator of a player character and stop the one with an animation named “ToolNoneAnim” to immediately stop the default hold animation from playing. Make sure the handler’s connection is disconnected when the tool is unequipped so other tools are unaffected.

I used the GetPlayingAnimationTracks method and AnimationPlayed event for this.

1 Like

Could you give me an example on how to code it? Would it go into the tool itself or do I have to change the animator script

1 Like

I’m sorry if you saw me post that suggestion to fork the Animate script, that is actually much more foolish than I had first assumed. If your game only uses custom animations, forking is fine. Forking the script copies all of the animation IDs in its children from the character you took it from. Unless you update those when a character is spawned or add animation-fetching functionality directly to Animate, a character will not use the animations set by the player that most games default to. Forking Animate just to add tool animation exceptions is perfect if you’ve already decided to abandon the avatar animations that players have bought and applied.

There’s a more adaptable solution. When the tool is equippied, you can fetch the player’s character, then their Humanoid, and then their Animator inside that Humanoid. The Animator has that method and event for currently playing animations, which provide an AnimationTrack. That AnimationTrack has an Animation property. Both the track and the animation have the same name, and in the case of the tool holding animation, it’s “ToolNoneAnim”. Just call AnimationTrack:Stop(0) if it’s named “ToolNoneAnim”.

1 Like

Sorry for the late response, I was busy. Here’s some code to put it in a equipped function. Also, change char:FindFirstChild("Right Arm") to char:FindFirstChild("RightLowerArm") if your character is R15, as the script would completely break without that change.

local flashlight = script.Parent.Flashlight

script.Parent.Equipped:Connect(function()
	local char = script.Parent.Parent
	local plr = game:GetService("Players"):GetPlayerFromCharacter(char)
	
	if plr then
		local Motor6D = Instance.new("Motor6D")
		Motor6D.Parent = char
		Motor6D.Part0 = char:FindFirstChild("Right Arm")
		Motor6D.Part1 = flashlight
		Motor6D.C1 = CFrame.new(Vector3.new(0, 1, 0))
	end
end)
1 Like

So it would remove it instantly or would there be a few frames with my arm up still? Thats the main issue right now

1 Like

And for this, how could I remove the inserted property once the tool was unequipped?

1 Like

Nothing is being removed. It’s stopping the animation the instant it begins, and from my testing, there was no evidence of the animation playing out even for a brief instant.

1 Like

I usually spam the tool first to check if the arm goes slightly up or it begins directly at where the animation wants it to be.

1 Like

But ill test it out tonight. Ill give you an update 6 hours from now

1 Like

Oh yeah, here you go:

local flashlight = script.Parent.Flashlight
local Motor6D

script.Parent.Equipped:Connect(function()
	local char = script.Parent.Parent
	local plr = game:GetService("Players"):GetPlayerFromCharacter(char)

	if plr then
		Motor6D = Instance.new("Motor6D")
		Motor6D.Parent = char
		Motor6D.Part0 = char:FindFirstChild("Right Arm")
		Motor6D.Part1 = flashlight
		Motor6D.C1 = CFrame.new(Vector3.new(0, 1, 0))
	end
end)

script.Parent.Unequipped:Connect(function()
	if Motor6D then
		Motor6D:Destroy()
		Motor6D = nil
	end
end)

Okay, I’m home. Is it just AnimationTrack:Stop(0) or do I have to define what AnimationTrack is? If so, how do I get it from the player?
image

You can index through each step in this chain from the tool’s parent character to its Animator, and the Animator lets you loop through the playing AnimationTracks and connect to the event for new ones that begin playing.

Could you give me a small example? I have never really dealt with going through the player Animator, I usually stay away from it unless I’m loading animations.

This is a snippet I’ve used before:

local character = tool:FindFirstAncestorOfClass("Model")
if not character then return end
local humanoid = character:FindFirstChildWhichIsA("Humanoid")
if not humanoid then return end
local animator = humanoid:FindFirstChildWhichIsA("Animator")
if not animator then return end
-- do stuff with animator

Note that this doesn’t care to wait for a character, Humanoid or Animator to show up if it doesn’t already exist, but that isn’t relevant since tools tend to become accessible long after all these things are asserted to exist. You could directly chain all those FindFirst calls if you don’t care about an irrelevant error about a link in that chain being missing.

And to remove or stop the ToolAnim from playing, I would just do

local AnimationTrack = animator
AnimationTrack:Stop(0)

I do apologize if I’m continuing it, I am just confused on where I’d get the AnimationTrack from.