Animation not playing the same way as editor

My animation works in the Moon Animator plugin as shown in the first video.

good animation

But when I play it in the game the animation does not play as expected as seen by the wooden stick not rotating all the way.

bad animation

I’ve tried looking for a solution but the problems that are quite similar to mine do not provide a solution. And yes, the animation priority is set to Action. I played around a bit and created another animation with the wooden stick not touching the right hand throughout. Likewise, it plays in the editor, but in-game there is no animation at all. Could the problem be due to the handle not touching the character properly?

Here’s my file explorer:

file explorer

Here’s the code inside LocalScript:

local player = game:GetService("Players").LocalPlayer
local tool = script.Parent
local anims = {script.Parent.Hit}
local animator
local loadedAnims = {}
local debounce = true
local cooldown = 2

tool.Activated:Connect(function()
	if debounce then
		debounce = false
		animator = player.Character:WaitForChild("Humanoid"):WaitForChild("Animator")
		if not loadedAnims[1] then
			loadedAnims[1] = animator:LoadAnimation(anims[1])
		end
		loadedAnims[1]:Play()
		
		wait(cooldown)
		debounce = true
	end
end)

tool.Unequipped:Connect(function()
	if loadedAnims[1] and loadedAnims[1].IsPlaying then
		loadedAnims[1]:Stop()
	end
end)

Any help is greatly appreciated!

It does play exact same animaton. You’re moving the tool on AnimationEditor but that won’t replicate to the actual animation. You need to change the tool grip when animation is played (i guess). I’m not a animator so i won’t give you any advices. Hope this explains why it doesn’t work as you expected.

As you can see, i had experiences so i’ll tell you the solution to this problem.

The problem is that on the NPC rig, it has a manually added motor6d inside the arms thus making the bat animate-able, however the default character (player character) doesn’t have one so you must create a line in the code where it would manually add a motor6d instance, connect it to the arm and the bat.

I’m too lazy to explain so you should find Headstackk’s animation tutorial which is a post.

You’re right. I didn’t create the Motor6D on my player and only did so for the dummy.