The anim wont load while there is no errors in the OutPut

Why wont the animation load?

wait()
local player = game.Players.LocalPlayer
local character = player.Character
local animation = script.Parent:FindFirstChild("Animation")
local holding = script.Parent:FindFirstChild("holding axe")
local swingAnimation = character:WaitForChild("Humanoid"):LoadAnimation(animation)
local slash = script.Parent.Handle.SlashSound

local canSwing = true
local debounce = 1

script.Parent.Activated:Connect(function()
	if canSwing then
		script.Parent.Enabled = false
		canSwing = false
		
		swingAnimation:Play()
		slash:Play()
		wait(debounce)
		script.Parent.Enabled = true
		canSwing = true
	end
end)

robloxapp-20240510-1733352.wmv (872.2 KB)

Maybe the problem is your animation’s ownership? The animation should be created by the creator of the game. So if the game is developed under you then the animation should be created by you. However, if the game is developed under a group, the animation’s owner probably needs to be set under that group.

It is, but why is it not working

Maybe try print debugging, put a bunch of print statements and see which statements print.

Im new to scripting so I dont really now what that is

Load the animation in the animator instance of the humanoid, you can’t load them in the humanoid anymore.

Could you demonstrate an example please?

… okay …

local swingAnimation = character:WaitForChild("Humanoid"):WaitForChild("Animator"):LoadAnimation(animation)
1 Like

Can I see a video of this demo?

It’s just like putting print statements all over your script. So in the if statment for example, if it doesn’t print then you know what the problem is.

Dude… it’s your script can’t you just do it yourself? Smh.

Replace your script with this new one.

wait()
local player = game.Players.LocalPlayer
local character = player.Character
local animation = script.Parent:FindFirstChild("Animation")
local holding = script.Parent:FindFirstChild("holding axe")
local swingAnimation = character:WaitForChild("Humanoid"):WaitForChild("Animator"):LoadAnimation(animation)
local slash = script.Parent.Handle.SlashSound

local canSwing = true
local debounce = 1

script.Parent.Activated:Connect(function()
	if canSwing then
		script.Parent.Enabled = false
		canSwing = false
		
		swingAnimation:Play()
		slash:Play()
		wait(debounce)
		script.Parent.Enabled = true
		canSwing = true
	end
end)

robloxapp-20240510-1823400.wmv (630.0 KB)

I’m confused on what you are showing in this clip? Is there something that is supposed to happen when you unequip or equip the axe?

.Activated is used for whenever you click while holding a weapon

hello!

make sure that the AnimationPriority of your saved animation is set to Action or higher

animation priority is basically a way of saying what animations should overlap other animations.
if your animation is set to Core (the default, and lowest) then the idle or walking animations (which are Idle and Movement respectfully) will overlap your animation and make it appear to not play.

the full list is:

  1. Core (lowest priority)

  2. Idle

  3. Movement

  4. Action

  5. Action2

  6. Action3

  7. Action4 (highest priority)

to change the animation priority, go into the animation editor and open your animation as normal,
then press the 3 dots…


then go to
Set Animation Priority > Action

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.