Remove jump anim on dash

So, i have this script for dashing and whenever the player dashes in the air, the animations looks like trash lol

So i wanted a way to disable the jump animation when dashing but enable it back when not dashing

i’ve tried changing the character’s “Animate” script but it looks bad when the player is just jumping without dashing

local UIS = game:GetService("UserInputService")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local player = Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local rootPart = char:WaitForChild("HumanoidRootPart")

local dashSpeed = 2000
local maxSpeed = 150
local groundBoost = 2
local dashTime = 0.5
local dashDelay = 0.7
local canDash = true

local leftDashAnim = "rbxassetid://117474809877047"
local rightDashAnim = "rbxassetid://129857834813992"

local anim = humanoid:FindFirstChildOfClass("Animator") or Instance.new("Animator", humanoid)

local leftAnim = Instance.new("Animation")
leftAnim.AnimationId = leftDashAnim
local leftTrack = anim:LoadAnimation(leftAnim)

local rightAnim = Instance.new("Animation")
rightAnim.AnimationId = rightDashAnim
local rightTrack = anim:LoadAnimation(rightAnim)

local gui = player:WaitForChild("PlayerGui"):FindFirstChild("DashUI")
if not gui then return end

local coolFrame = gui:FindFirstChild("CooldownFrame")
local fillBar = coolFrame:FindFirstChild("FillFrame")

local function isOnGround()
    return humanoid.FloorMaterial ~= Enum.Material.Air
end

local function doDash(dir)
    if not canDash then return end
    canDash = false  

    local origJump = humanoid.JumpPower
    humanoid.JumpPower = 0
    humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)

    fillBar.Size = UDim2.new(0, 0, 1, 0)
    task.spawn(function()
        for i = 0, 1, 0.01 do
            fillBar.Size = UDim2.new(i, 0, 1, 0)
            task.wait(dashDelay / 100)
        end
        fillBar.Size = UDim2.new(1, 0, 1, 0)
        canDash = true 
    end)

    local dashForce = dashSpeed
    if isOnGround() then
        dashForce = dashSpeed * groundBoost
    end

    if dashForce > maxSpeed then
        dashForce = maxSpeed
    end

    local dashDir = rootPart.CFrame.RightVector * dir
    local dashVel = dashDir * dashForce

    local newVel = Vector3.new(dashVel.X, rootPart.Velocity.Y, dashVel.Z)
    rootPart.Velocity = newVel

    if dir < 0 then
        leftTrack:Play()
    elseif dir > 0 then
        rightTrack:Play()
    end

    task.wait(dashTime)

    leftTrack:Stop()
    rightTrack:Stop()

    humanoid.JumpPower = origJump
    humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
end

UIS.InputBegan:Connect(function(input, processed)
    if processed then return end

    if input.KeyCode == Enum.KeyCode.LeftControl then
        local moveDir = humanoid.MoveDirection
        local rightVec = rootPart.CFrame.RightVector 

        local dotProd = moveDir:Dot(rightVec)

        if dotProd > 0 then
            doDash(1) 
        elseif dotProd < 0 then
            doDash(-1) 
        end
    end
end)

You can visually override the jumping (and/or the falling) animations by playing an animation with a higher priority. (This is what I would recommend.)

You can swap the jumping animation for an alternative by removing the Animation under the instance value named “jump” (which is stored under the “Animate” LocalScript in the character) and replacing it with a different Animation.

If you add a video with how it currently looks we can give you better recommendations.


this is what i mean by “Lookin weird”
How do i set priorities on animations?

When you make the animation you can select a priority. You probably want to select “Action” to override “Movement” and “Idle”.

The docs have a tutorial that talks about setting the priority:


Another note about priority: it only overrides the animations of body parts it controls, so make sure your animation has a dot next to all the parts you want it to override. Otherwise the lower priority animations will control those parts.

1 Like

(DashAnimInstance).Priority = Enum.AnimationPriority.Action

this will set the priority to the highest

Oh, thanks, by overriding “movement” and “idle” it also overrides jumping and fall, right?

1 Like

setting the priority overrides all animations

(Technically there are 4 levels of action priority, though the regular animations are all below Action.)

1 Like

Yeah jumping is Movement. Falling is either Idle or Movement. So both are lower.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.