Weapon animation not working perfectly

My animations for my hammer tool is supposed to look like this video in Moon Animator…

But during gameplay, the hammer is unable to rotate on its own, so I think I am missing something in my LocalScripts that allows it to rotate freely.

Both of my local scripts in the tool are below. The same problem happens in the idle animation too, but it’s hard to notice.

Swinging animation LocalScript

local tool = script.Parent
local anim = Instance.new("Animation")

anim.Name = "attackAnim"
anim.AnimationId = "rbxassetid://11746338210" -- Animaton ID

local track
local canRun = true

tool.Activated:Connect(function()
	if canRun then
		canRun = false
		track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
		track.Priority = Enum.AnimationPriority.Action
		track:Play()
		
		wait(0.5)
		canRun = true
	end
end)

Idle animation LocalScript

local tool = script.Parent
local animIdle = Instance.new("Animation")

animIdle.Name = "IdleAnim"
animIdle.AnimationId = "rbxassetid://10778605557" -- Idle animaton ID

local track

tool.Equipped:Connect(function()
	track = script.Parent.Parent.Humanoid:LoadAnimation(animIdle)
	track.Priority = Enum.AnimationPriority.Movement
	track.Looped = true
	track:Play()
end)

tool.Unequipped:Connect(function()
	if track then
		track:Stop()
	end
end)

Thanks for reading.

1 Like

You have both the idle and attack animation priority set to movement. Try changing is to this

		track.Priority = Enum.AnimationPriority.Action

1 Like

Change that inside of the attack animation script

My mistake, but I copy-pasted the wrong script, so the attacking animation does have Priority set to action. I’ll edited it later as of writing.

Even when I changed it though, it still didn’t change the movement of the Handle.

Can you send me the place so i can take a look?

And i have a raycast system you can have if you want. Just make sure to add your own animations.
sword (2).rbxm (21.6 KB)

1 Like

You can have up to 4 animations with this one i believe. It also has a sword swing sound you can add as well as a hit sound when you hit an enemy.

Absolutely. Here you go.
hammerAnimDemo.rbxl (76.7 KB)

Does the tool automatically swing for you?

The tool is not “autoclick when held down” if that’s what you mean.

Tell me if this works

hammerAnimDemo.rbxl (85.4 KB)

use this one instead. I saved the animation inside the dummy for you

hammerAnimDemo.rbxl (85.5 KB)

I don’t think this is what I am looking to accomplish. All I’m trying to do is make the in-game animation look the same as how it looks in Moon Animator.

Yeah but for some reason whenever i equip the tool he just starts swinging it automatically so i thought it was happening to you to lol as for the animation for some reason it only happens with moon animator. The default animation plugin seems to work fine.

I never used moon animator tbh so i don’t have any idea why its doing that. I thought maybe it was script or rig type related

Okay, that’s fine. my best guess is that I need to use a Motor6D to animate it correctly ingame.