I am trying to make a dash system similar to strongest battlegrounds where the dash is changed and determined where your character faces. I’ve tried using both BodyVelocity and LinearVelocity to attempt to make this happen, but the dash doesn’t come out as smooth and responsive as the other game.
I’ve also tried changing the velocity and direction through a while loop, but the dash decides not to turn. I’ve looked through the Devforum, but they didn’t specifically explained how they did it.
local function slide(dir, lv,)
local thread = coroutine.wrap(function()
while changeDir do
wait()
if dir == "Left" then
lv.VectorVelocity = char.Torso.CFrame.RightVector * -80
elseif dir == "Right" then
lv.VectorVelocity = char.Torso.CFrame.RightVector * 80
elseif dir == "Forward" then
lv.VectorVelocity = char.Torso.CFrame.LookVector * 80
elseif dir == "Backward" then
lv.VectorVelocity = char.Torso.CFrame.LookVector * -80
end
end
end)
thread()
end
local function dash()
if canDash.Value == true then
canDash.Value = false
changeDir = true
local attachment = Instance.new("Attachment", char.Torso)
local lv = Instance.new("LinearVelocity", attachment)
lv.MaxForce = math.huge
lv.Attachment0 = attachment
if (hum.MoveDirection:Dot(hrp.CFrame.RightVector) > 0.75) then
slide("Right", lv, attachment)
elseif (hum.MoveDirection:Dot(-hrp.CFrame.RightVector) > 0.75) then
slide("Left", lv, attachment)
elseif (hum.MoveDirection:Dot(-hrp.CFrame.LookVector) > 0.75) then
slide("Backward", lv, attachment)
elseif (hum.MoveDirection:Dot(hrp.CFrame.LookVector) > 0.75) then
slide("Forward", lv, attachment)
end
wait(0.3)
changeDir = false
lv:Remove()
attachment:Remove()
player.PlayerGui["Abilities GUI"]["Dash Button"].TextColor3 = Color3.fromRGB(255, 0, 0)
for i = 2, 1, -1 do
player.PlayerGui["Abilities GUI"]["Dash Button"].Text = i.."s"
wait(1)
end
player.PlayerGui["Abilities GUI"]["Dash Button"].Text = "Q / RB"
player.PlayerGui["Abilities GUI"]["Dash Button"].TextColor3 = Color3.fromRGB(255, 255, 255)
canDash.Value = true
end
end
How should a plan to script a very smooth dash system like strongest battlegrounds?
Although that’s not a bad idea to add that to the dash system, is there a way to make the dash come out smooth and respond very quickly to camera turns?
the way game like Strongest Battlegrounds and other games following the battlegrounds format make their game smooth looking is they use a trick to track the camera to the characters head or torso. But this would make the smoothness very dependent on your animation.
The dash still decides to make sharp turns a few milliseconds after the turn of the camera. How do I fix the dash to automatically turn as soon as my camera turns?
I believe TSB handles the dashing movement part in the client instead of the server, it also uses some sort of acceleration system rather than just keeping a constant velocity for a few seconds
The way the solution is executed should not matter. BodyVelocity and BodyPosition are deprecated, and VectorForce would not be very helpful in this scenario where a controlled velocity is intended. LinearVelocity seems quite viable at this stage.
like im setting the linearvelocity normally like setting its attachment0 to an attachment so if i flick it like 90degrees it accelerates for some reason