so i was making a dash system, where when a player presses a key then a body velocity is cloned into them, problem is that whenever I used the dash ability it sometimes puts me into the ground.
like its not moving the character complete straight its sorta moving them towards the ground
local rs = game:GetService("ReplicatedStorage")
local dashevent = rs:WaitForChild("Dash")
dashevent.OnServerEvent:Connect(function(plr)
local chr = plr.Character
local rootpart = chr.PrimaryPart
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bv.Velocity = rootpart.CFrame.LookVector * 50
bv.Parent = rootpart
task.wait(0.3)
bv:Destroy()
end)
local script Is
local uis = game:GetService("UserInputService")
local rs = game:GetService("ReplicatedStorage")
local dashevent = rs:WaitForChild("Dash")
local player = game:GetService("Players").LocalPlayer
local chr = player.Character
local hum = chr:WaitForChild("Humanoid")
local debounce = false
uis.InputBegan:Connect(function(input,e)
if e then return end
if input.KeyCode == Enum.KeyCode.Q and debounce == false then
debounce = true
local dashanim = game:GetService("ReplicatedFirst").Animations.DashAnim
local dashtrack = hum:LoadAnimation(dashanim)
dashtrack:Play()
task.wait(0.2)
dashevent:FireServer()
task.wait(0.5)
dashtrack:Stop()
task.wait(1)
debounce = false
end
end)