Animation not working correctly when testing

Hello,

So I made an animation and a script that fires the animation but when I test the game the animation only works for the half.

This is the script:`

local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local animation = script.Parent:FindFirstChild("Animation")
local swingAnim = character:WaitForChild("Humanoid"):LoadAnimation(animation)

local swing = true
script.Parent.Activated:Connect(function()
	if swing then
		swing = false
		swingAnim:Play()
		wait(.5)
		swing = true
	end
end)

And this is a vid of the animation:

And here is a vid of the animation not working:

The animation also loops the entire time so can anyone help me with this?

4 Likes

animation priority must be set to movement or action, plus in the animation editor you set the animation to looped

1 Like

I did that but it sill doesn’t works.

did you override/save the animation? plus, you’re using the deprecated method of LoadAnimation, you now have to load it inside the humanoid’s Animator

local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local animation = script.Parent:WaitForChild("Animation")
local animator = character:WaitForChild("Humanoid"):WaitForChild("Animator")
local swingAnim = animator:LoadAnimation(animation)

local swing = true
script.Parent.Activated:Connect(function()
	if swing then
		swing = false
		swingAnim:Play()
		wait(.5)
		swing = true
	end
end)

I overrided the animation but still no changes I also copied your script.

The problem you are facing is that you are using a tool with a handle. The handle animation overrides the one you made.

The way i work around this thing is not using a handle part, but welding it with a weld

Also you will need to uncheck requiresHandle for this method to work

I deleted the handle and set RequiresHandle to false but it still does the same.

Can you include a video, so i can try and figure out the problem?

Also, you just needed to rename the handle to something else than “handle” so it doesn’t stick to the arm and break it’s animation

Well no… I changed it in the script now its unlooped but the weird animation is still there.

i meant to uncheck “looped” in the animation editor (if you didn’t already)
same for the animation editor click the three dots → set animation priority → Action

I’ve already did that 30 minutes ago or something

What is the animation priority currently?

Can i see the pickaxe in the game explorer also it’s properties?

Action not action 1 or 2 or 3 or 4

Is the published animations Priority the same?

image

You still have the part called “Handle”, change that to something else

When you do that, the pickaxe should just fall on the ground or appear somewhere.