#Animation Stutter

1 messages · Page 1 of 1 (latest)

dry summit
#

How do i fix the animation from stuttering when inputting movement keys fast or at weird times?

modern hatchBOT
#

studio** You are now Level 2! **studio

ruby quiver
#

Send your script

dry summit
# ruby quiver Send your script

local tool = script.Parent
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local RPS = game:GetService("ReplicatedStorage")
local animator = humanoid:FindFirstChild("Animator")

local idleAnim = RPS.Animations.Idle
local walkAnim = RPS.Animations.Walk
local idleTrack = animator:LoadAnimation(idleAnim)
local walkTrack = animator:LoadAnimation(walkAnim)

idleTrack.Priority = 0
walkTrack.Priority = 1

local equipped = false

tool.Equipped:Connect(function()
print("tool equipped")
equipped = true
idleTrack:Play()

UIS.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        local anim = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.M1)
        anim:Play()
    elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
        local anim = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.M2)
        anim:Play()
    elseif input.KeyCode == Enum.KeyCode.LeftControl then
        local anim = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Crouch)
        anim:Play()
    elseif input.KeyCode == Enum.KeyCode.F then
        local anim = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Block)
        anim:Play()
    elseif input.KeyCode == Enum.KeyCode.Space then
        local anim = script.Parent.Parent.Humanoid:LoadAnimation(script.Parent.Jump)
        anim:Play()
    end
    
    
end)

end)

tool.Unequipped:Connect(function()
print("tool unequipped")
equipped = false
idleTrack:Stop()
end)

humanoid.Running:Connect(function(speed)

if equipped == true and speed > 0 then
    walkTrack:Play()
end

if speed == 0 then
    walkTrack:Stop()
end

end)

ruby quiver
dry summit
ruby quiver
dry summit
#

Oh I see thanks

ruby quiver
#

Load the animation every time the humanoid loads