How to stop player from falling during dash

Basically, I am trying to change my dash code from using Body Velocity to Linear Velocity. But, for some reason, they won’t act the same. Linear velocity is fine during slow speed but makes the player fall during high speed while Body Velocity does fine with both applications. I’d like to find ways to fix this.

local UIS = game:GetService("UserInputService")
local Debris = game:GetService("Debris")

local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local humrp = char:WaitForChild("HumanoidRootPart")

local root = humrp:FindFirstChild("RootRigAttachment")


UIS.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.Q and UIS:IsKeyDown(Enum.KeyCode.W) then
	
	    local lv = Instance.new("LinearVelocity")
		lv.MaxForce = math.huge
		lv.Attachment0 = root
		lv.VectorVelocity = Vector3.new(humrp.CFrame.lookVector.x, 0, humrp.CFrame.lookVector.z) * 600
		lv.Parent = humrp
	
		Debris:AddItem(lv, 0.2)
		
	end
end)
2 Likes

Apply an upwards force of the world gravity + player’s weight.

1 Like