I am having an issue with my dash ability when the character lands after falling. When the user jumps and then dashes in air, the user should fall and land on the ground naturally but when doing so, The character glitches through the ground briefly and then goes back to standing normally on the ground.

--------- Services

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UIS = game:GetService("UserInputService")
local Ts = game:GetService("TweenService")

----------- Effects ------------

local Effects = ReplicatedStorage:WaitForChild("Effects")
local Path = Effects:WaitForChild("ExplosionPath")
local Punch = Effects:WaitForChild("PunchRings")

------- Other -----------
local Camera = game.Workspace.CurrentCamera
local char = script.Parent.Parent
local slideAnim = Instance.new("Animation")
local dashSound = script:WaitForChild("DashSound")

---------- Things to Configure ---------
OgFieldOfView = 70
IncFeildOfView = 90
DashDistance = 100
DashCoolDown = 3
slideAnim.AnimationId = "rbxassetid://16019918773" -- Enter your AnimationID
local keybind = Enum.KeyCode.Q -- between the key for ability

------- BoolValues -------------

local canslide = true

------ Main script -------

UIS.InputBegan:Connect(function(input, gameprocessed)
    if gameprocessed then return end
    if not canslide then return end

    if input.KeyCode == keybind then
        canslide = false

        -------- Effects

        local PathClone = Path:Clone()
        PathClone.Parent = workspace
        PathClone.Rotation = char.HumanoidRootPart.Rotation
        PathClone.Position = char.HumanoidRootPart.Position - Vector3.new(0, 2, 0)
        local PunchClone = Punch:Clone()
        PunchClone.Parent = workspace
        PunchClone.Rotation = char.HumanoidRootPart.Rotation
        PunchClone.Position = char.HumanoidRootPart.Position

        --------- script

        dashSound:Play()
        Ts:Create(Camera, TweenInfo.new(1, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out), {FieldOfView = IncFeildOfView}):Play()
        char.CameraManipulation.ShakeScript.Disabled = false

        local playAnim = char.Humanoid:LoadAnimation(slideAnim)
        playAnim:Play()

        local canJump = true  

        
        local connection
        connection = char.Humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
            if not canJump then
                char.Humanoid.Jump = false
            end
        end)

        local slide = Instance.new("BodyVelocity")
        slide.MaxForce = Vector3.new(999999, 999999, 999999)
        slide.Velocity = char.HumanoidRootPart.CFrame.lookVector * DashDistance
        slide.Parent = char.HumanoidRootPart

        local bodyForce = Instance.new("BodyForce")
        bodyForce.Force = Vector3.new(0, -char.Humanoid.WalkSpeed * 40, 0) 
        bodyForce.Parent = char.HumanoidRootPart

        wait(0.1) 

        Ts:Create(Camera, TweenInfo.new(1, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out), {FieldOfView = OgFieldOfView}):Play()
        for count = 1, 8 do
            wait(0.1)
            slide.Velocity = Vector3.new(slide.Velocity.X, -char.Humanoid.WalkSpeed * 2, slide.Velocity.Z) 
            slide.Velocity *= 0.7
        end

        
        local humanoid = char.Humanoid
        local ray = Ray.new(char.HumanoidRootPart.Position, Vector3.new(0, -5, 0))
        local hitPart, hitPosition = workspace:FindPartOnRay(ray, char, false, true)

        if hitPart then
            local safePosition = hitPosition + Vector3.new(0, humanoid.HipHeight, 0)
            humanoid:Move(safePosition - humanoid.Parent.PrimaryPart.Position)
        end

        
        if char.Humanoid:GetState() == Enum.HumanoidStateType.Landed then
            
            char.Humanoid.WalkSpeed = 16
        end

        playAnim:Stop()
        slide:Destroy()
        bodyForce:Destroy()

        
        canJump = true
        connection:Disconnect()

        char.CameraManipulation.ShakeScript.Disabled = true
        PunchClone:Destroy()
        PathClone:Destroy()

        wait(DashCoolDown)
        canslide = true
    end
end)

Please help

I tried changing the fall speed around as well as the hipheight but they didn’t fix the issue