I am attempting to create a dash but there is one problem. Whenever the player is not in the air as they use the dash, the dash is very limited in the length you go. Barely working.
Here is a snippet of that code:
local humanoid = character:FindFirstChild("Humanoid")
local humRp = character:FindFirstChild("HumanoidRootPart")
if humRp and humanoid then
local velocity = Instance.new("LinearVelocity")
velocity.Attachment0 = humRp:FindFirstChildOfClass("Attachment")
task.spawn(function()
while task.wait() do
if not velocity then break end
velocity.VectorVelocity = humRp.CFrame.LookVector*110
local ray = workspace:Raycast(humRp.Position,humRp.CFrame.LookVector*.1)
if ray then
velocity:Destroy()
mation:Stop()
end
end
end)
velocity.MaxForce = 100000
velocity.Parent = humRp
game.Debris:AddItem(velocity,.1)
end
any help is greatly appreciated