Im making a PVP game, and when I click ‘E’ it uses my hammer throw move. The animation works perfectly as long as I havent walked, after I walk, it breaks the animation. How can I fix this?
Ive tried preloading the animation on the client and on the server, Ive also tried just making an entirely new animation every time I fire the move but it all does the same thing.
Here is my code
local plr = game.Players.LocalPlayer
local function animMaker(Humanoid, ID)
local animObject = Instance.new("Animation")
animObject.Parent = Humanoid.Parent
animObject.Name = tostring(ID)
animObject.AnimationId = "rbxassetid://"..ID
local animation = Humanoid:LoadAnimation(animObject)
return animation
end
plr.CharacterAdded:Connect(function(chr)
local humanoid = chr:WaitForChild("Humanoid")
local animTable = {
HammerThrow = animMaker(humanoid, "9156958737")--"9149634529")
}
game.ReplicatedStorage.animatedeeznu.OnClientEvent:Connect(function(animation, startStop)
if chr~=nil and humanoid then
if startStop == "start" then
animTable[animation]:Play()
else
animTable[animation]:Stop()
end
end
end)
end)
here is a video of the bug - video of the bug