My animation works in the Moon Animator plugin as shown in the first video.
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.
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:
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!