#tool animations

1 messages · Page 1 of 1 (latest)

sharp grail
#

i'm trying to give tools custom animations when held.

my first issue is that if the player is running (default animation) and then equips the tool, the regular running animation stacks with my custom one making certain parts like the wrist act wonky even though my custom one has a higher priority. how do i shut off the regular animations?

my second issue is that when i switch between a custom running animation and a custom idle anmation, it takes around a second to shift when i run and then stop with noticable lag.

this is my equip script for the tool:
all of the variables are denoted before

    print("equip")
    
    humanoid = tool.Parent:FindFirstChild("Humanoid")
    idletrack = humanoid.Animator:LoadAnimation(idle)
    runtrack = humanoid.Animator:LoadAnimation(run)
    
    animate = tool.Parent.Animate
    animate.Enabled = false

    for _, track in pairs(humanoid.Animator:GetPlayingAnimationTracks()) do
        track:Stop()
    end

    idletrack:Play()
    
    runfunc = humanoid.Running:Connect((function(speed)
        print("running ", speed)
        if speed > 0 and not trackstatus then
            trackstatus = true
            idletrack:Stop()
            runtrack:Play()
            print("track started")
        elseif speed == 0 then
            trackstatus = false
            runtrack:Stop()
            idletrack:Play()
        end
    end))

end))```
cosmic ocean
#

first issue's solution: reupload animation but change the priority to action1. second issue potential solution: define the animaiton variables outside of the equiped function so it only runs once, then you dont have to reload both animations every time player equips, hope this helps!