Axe animation lagging

I have a hit animation for my axe and it lags in game but not in the animation editor.

This is how it’s suppossed to look:
https://gyazo.com/a69d84f1d36b1e81539575cecc0a850b

This is how it’s in game/play test:
https://gyazo.com/83ec83244685c2f5c5a88b8b7b2a8ead

The FPS on the animation is set to 60

How about your script?
Are you loading the animation each time it plays, or at the beginning of the script and then just playing it when it needs to?

Also what is the frame rate when you play the game? You can set the animation at 60 fps, but if you play and only get 40 fps then there will be an issue.

The animations get loaded when the axe gets equipped like this:

self:LoadAnimations()
self:PlayAnimation("Hold")
function Axe:LoadAnimations()
	local Character = self.Instance.Parent
	local Humanoid = Character:FindFirstChild("Humanoid")

	if not (Humanoid) then return end

	table.clear(self.Animations)
	for _, AnimationInstance in pairs(ReplicatedStorage.Config.Tools.Axe.Animations:GetChildren()) do
		self.Animations[AnimationInstance.Name] = Humanoid:LoadAnimation(AnimationInstance)
	end
end
function Axe:PlayAnimation(AnimationName)
	local Animation = self:GetAnimation(AnimationName)
	if not (Animation) then return end

	Animation:Play()
	table.insert(self.PlayingAnimations, Animation)

	return Animation
end

Is the animation priority Action?

Yes, the animation priority is Action2

Maybe there’s an error with this function?

Also, might I suggest using AnimationController:LoadAnimation() instead of Humanoid:LoadAnimaton()? It’ kinda janky sometimes and i don’t really know why, but animation controllers are better apparently.

I tried without the function and it still didn’t work. And I already switched it out to Animator:LoadAnimation()

No, don’t use animator! use animationcontrollers! Also, you may have inserted your animation instance Id’s or animation names wrong and played two of the same animations at the same time.

How do I use/add an AnimationController? And I tried playing the animation from the command bar on the dummy and it got the same result (laggy)

Well then, it sounds like your animation was messed up or something, check it just to make sure it’s okay.

1 Like

I ran out of ideas so I reanimated it, and it works now!

1 Like