Tool animation not playing

I created an animation for a tool whenever it is activated, but it does not work. I followed a community tutorial in the forum to animate my tool. There is no error in the output, and the animation is owned by me. Every variable seems to be in place too. I have also tried to look through the forums, with no real solutions to my problem. Can anyone help?

Client Script (within tool)
local Players = game:GetService("Players")

local localPlayer = Players.LocalPlayer
local localCharacter = localPlayer.Character or localPlayer.CharacterAdded:wait()
local localHumanoid = localCharacter.Humanoid

local toolFire = zapperTool:WaitForChild("toolFire") -- Animation
local toolTrack= localHumanoid:LoadAnimation(toolFire)

tool.Activated:Connect(function()
	toolTrack.Priority = Enum.AnimationPriority.Action
	toolTrack.Looped = false
	toolTrack:Play()
end)
3 Likes

You called the Local Player uncorrectly, it should be:

local localPlayer = game.Players.LocalPlayer

I think I know the issue, it could be that glitch from Roblox where animation doesn’t work from your account, this happened to me, I found the solution however by uploading these animations to a group, not sure if its gonna work for you, but it did for me.

2 Likes

Here

    local localPlayer = game.Players.LocalPlayer
    local localCharacter = localPlayer.Character or localPlayer.CharacterAdded:wait()
    local localHumanoid = localCharacter.Humanoid

    local toolFire = zapperTool:WaitForChild("toolFire") -- Animation
    local toolTrack= localHumanoid:LoadAnimation(toolFire)

    tool.Activated:Connect(function()
    	toolTrack.Priority = Enum.AnimationPriority.Action
    	toolTrack.Looped = false
    	toolTrack:Play()
    end)
5 Likes

@ninjabb2 and @FlamingGuards I stored the player service in ‘Players’.

Hmm, I don’t have a group and I can’t afford one, but I’ll keep that in mind.

2 Likes

perhaps you can ask someone to upload it for you.

1 Like

Maybe the problem is you are calling the humanoid before it loads. Try waiting for it by:

local localHumanoid = localCharacter:WaitForChild("Humanoid")
1 Like

If that’s not the case, make sure you have the RequiresHandle option unselected inside your tool if it doesn’t have any handle.
RequiresHandleOff

Did not work, and I already have the ‘RequiresHandle’ unselected. Wierd. Thank you for the suggestions though.

1 Like

It is… Because I tested it myself and the animation played without problems. If the animation would’nt be made by you, the roblox would automatically tell you inside the output. The script is fine, which leaves me thinking there is something wrong with your settings. Try checking if you have all the options set correctly, if you’re playing the right animation with the right animation ID, if you’re not mixing r15 with r6. If that doesn’t work maybe try reuploading the animation.

1 Like

Reuploaded the animation and made sure it was in r6, with no luck.

I have a question, does the tool model I animate with have to mirror the structure of the tool? The model of the tool only has parts, while the actual tool has a folder to store those parts along with remotes and scripts. If I changed a parts material when the animation is suppose to play, will it not play?

1 Like

Bro, I’ve got lost.
We probably need to look deeper into this so can you please provide some information on what are you trying to achieve + some photos of how is your TOOL MODEL built in the game (meaning in explorer, where are the parts located), maybe than we can find a solution.

1 Like

Sorry for the confusing you, here are some pictures. The one on the left is the one I used for animating, while the actual tool is on the right.

toolModel tool

1 Like

I’ve read the tutorial u linked here before and I can see there is a Part named Handle in the Model (Left picture) so I’m assuming you should rename it. Also be sure you do not have any welds inside those parts as well. If you do, make sure to turn off this feature and then delete them:

joinsurfacesoff

Make sure you do not have any of those parts anchored and collidable. Also before playing the animation make sure you have the Torso motor attached to the Model’s BodyAttach part and that you have the model inside player’s character. I would like to know what are the parts inside the tool meant for, if you already have the model somehow attached to your character’s body, why having another parts inside the tool especially the one named ‘Handle’ and the folder named ‘Parts’.

I realized that I had welds in my tool, so I had to fix that. I have a specific folder for parts for customization purposes.

But, I followed the tutorial again, only to have another problem specific to the tutorial. The tool is now stuck in the torso, and I have no idea why and how to fix it. I made a post there, and I hope someone could help me.

fail

The tool is stuck in the torso because the tutorial says to attach the tool to the torso, so it’s initial position is in the torso

I think the problem here is that the animation isn’t playing, so therefore the tool is stuck in it’s initial position.

You could try setting the priority in the animation editor which seems to work for me, and if that doesn’t work then I don’t really have anymore suggestions

Wow. I just realized something. The model of the tool has ‘BodyAttatch’, while the tool has a correctly spelled, ‘BodyAttach’. I animated the tool with a misspelled part, so in the actual tool it isn’t able to animate because the part was spelled correctly.

Oh my goodness.

1 Like

Now, I need help on how to play two animations at once. I have an equipped animation with an action priority, and it keeps the player’s right arm up with the tool. (so it’s looped)

But, I also want another animation with a priority set to action to play when my tool is fired, which keeps the arm up but adding an animation to the tool.

I’ve tried changing the weight of the equipped animation, but it results in an unintended animation. I’ve also tried to stop the equipped animation and then play the fired animation, but that also doesn’t work. How would I go about this?

EDIT: Just set equipped animation to movement priority and the animation will work