Dashes longer when on air?

local bv = Instance.new("BodyVelocity")
bv.Name = "BV"
bv.MaxForce = Vector3.new(500000, 0, 500000)
bv.Velocity = humRootPart.CFrame.lookVector * 100
bv.Parent = humRootPart

So this is my dashing script and it works great. But I have a problem, where whenever I jump and dash, it dashes longer or further compared to when the I am on the ground

Any fix for this?

1 Like

I think thats normal cuz you are on air

Not really, since when you are in the air roblox doesn’t apply friction.

if you want it to go the same as the ground, maybe check if the player is on air, then reduce the multiplier by how much you want

Check if the humanoid state is jumping.

humanoid.StateChanged:Connect(function(old, new)
    if new == Enum.HumanoidStateType.Jumping then
        -- code here (maybe just lower the body velocity)
    end
end)
humanoid.StateChanged:Connect(function(old, new)
    if new == Enum.HumanoidStateType.Landed then
        -- code here (raise velocity)
    end
end)
1 Like

add HumanoidStateType.Climbing cuz it will be the same velocity if it just climb

1 Like

try to avoid having to much Connection, use this instead:

humanoid.StateChanged:Connect(function(old, new)
	if new == Enum.HumanoidStateType.Jumping then
		-- code (decrease the velocity multiplier)
	elseif new == Enum.HumanoidStateType.Landed or new == Enum.HumanoidStateType.Climbing then
		-- code (increase the velocity multiplier)
	end
end)
3 Likes

I recommend following this youtube tutorial:

It deals with the issue you have and will save you several headaches later. It will automatically check for any obstructions in the dash direction and pause the dash before collision. Additionally, you can learn from it and write your own.

The other solutions in this thread are very band-aid and don’t tackle the main issue, which is combating friction.

2 Likes

Maybe just use linear force and set the relative to attachment0

local lv = Instance.new("LinearVelocity")
lv.Name = "LV"
lv.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
lv.Attachment0 = humRootPart.RootAttachment
lv.ForceLimitMode = Enum.ForceLimitMode.Magnitude
lv.MaxForce = 10000
lv.Parent = humRootPart

and maybe make every body part that is a basepart massless but if you don’t then higher the maxforce

1 Like

hi, i fixed this 3 days ago after an entire year of torture:

the floor has friction, so one of the fixes is to put the friction to 0, but you have to do this with all the parts

my fix was to use Linear velocity

local attach = Instance.new("Attachment", HumanoidRootPart)
local velocity = Instance.new("LinearVelocity", HumanoidRootPart)
velocity.MaxForce = math.huge
velocity.Attachment0 = attach
velocity.VelocityConstraintMode = Enum.VelocityConstraintMode.Vector
velocity.RelativeTo = Enum.ActuatorRelativeTo.Attachment0
attach.WorldPosition = hrp.AssemblyCenterOfMass

-- this is for the force being applied, basically the dash
velocity.VectorVelocity = Vector3.new(0,0,-force) -- make sure to make the Z negative to make the dash forward
1 Like