I'm trying to make a script to dash left or right. So far it works but not as good as I want.
Dash = function(velocity, anim)
local bodyV = Instance.new("BodyVelocity", char.HumanoidRootPart)
bodyV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyV.P = 100
bodyV.Velocity = velocity * 60
game.Debris:AddItem(bodyV, 0.2)
anim:Play()
end
This is the code I'm using. The problem is that if I dash when I'm on the ground I move very little but if I jump and dash I move further. How can I make it so that it always dashes the same distance even if I'm jumping and in the same amount of time?
