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.
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
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’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”.
Sorry for the late response, I was busy. Here’s some code to put it in a equipped function. Also, changechar:FindFirstChild("Right Arm")tochar: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)
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.
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)
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.
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.