Hi there, I have scripted a dash system but i dont know how to make the side dashes smoother like strongest battlegrounds… I was wondering if anyone had any tips on how I can achieve it?
My dashes : Watch 2024-03-20 16-28-16 | Streamable
The dashses I want to replicate : Watch 2024-03-20 16-28-45 | Streamable
this is the code for the side dashes
-- the code is obv cut....
local dashConfig = {
forward = {speed = 100, time = 1},
backward = {speed = 75, time = 1},
left = {speed = 75, time = 0.5},
right = {speed = 75, time = 0.5}
}
isDashing = true
dashDirection = directionKey
lastDashTimes[directionKey] = tick()
lastDashTimeAnyDirection = tick()
local oldWalkSpeed = character.Humanoid.WalkSpeed
character.Humanoid.WalkSpeed = 0
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.MaxForce = Vector3.new(50000, 0, 50000)
bodyVelocity.P = 12500
bodyVelocity.Parent = character:FindFirstChild("HumanoidRootPart")
local startingPosition = character:FindFirstChild("HumanoidRootPart").Position
local estimatedFinal = character:FindFirstChild("HumanoidRootPart").CFrame.Position + (character:FindFirstChild("HumanoidRootPart").CFrame.LookVector * (bodyVelocity.MaxForce / 850))
-- cut here again
local currentTime = tick()
local currentDirectionVector = initialDirection
if dashDirection == "forward" then
if UserInputService:IsKeyDown(Enum.KeyCode.W) then
currentDirectionVector = character:FindFirstChild("HumanoidRootPart").CFrame.LookVector
end
elseif dashDirection == "left" then
if UserInputService:IsKeyDown(Enum.KeyCode.A) then
currentDirectionVector = -character:FindFirstChild("HumanoidRootPart").CFrame.RightVector
end
elseif dashDirection == "backward" then
if UserInputService:IsKeyDown(Enum.KeyCode.S) then
currentDirectionVector = -character:FindFirstChild("HumanoidRootPart").CFrame.LookVector
end
elseif dashDirection == "right" then
if UserInputService:IsKeyDown(Enum.KeyCode.D) then
currentDirectionVector = character:FindFirstChild("HumanoidRootPart").CFrame.RightVector
end
end