For Some Reason the animation in my game are acting wonky
game.UserInputService.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
punching = true
if punchable == true then
punchable = false
if punch == 2 then
if punching == true then
punching = false
if punching ~= true then
local punch2anim = animator:LoadAnimation(script.Punch2)
punch2anim.Looped = false
punch2anim.Priority = Enum.AnimationPriority.Action2
game.ReplicatedStorage.Punch:FireServer(LocalPlayer)
punch2anim:Play()
punch2anim:GetMarkerReachedSignal("HIT"):Connect(function()
game.ReplicatedStorage.Punch:FireServer(LocalPlayer)
end)
print("a")
end
end
task.wait(1.5)
punchable = true
punch = 1
end
if punch == 1 then
if punching == true then
punching = false
if punching ~= true then
local punch1anim = animator:LoadAnimation(script.Punch1)
punch1anim.Looped = false
punch1anim.Priority = Enum.AnimationPriority.Action
punch1anim:Play()
punch1anim:GetMarkerReachedSignal("HIT"):Connect(function()
game.ReplicatedStorage.Punch:FireServer(LocalPlayer)
end)
print("ab")
end
end
task.wait(1.5)
punchable = true
punch = 2
end
end
end
end)
You Can See In The Video that The animations are sometimes choppy and sometimes the same animation plays twice in a row