Help making a dynamic dash

Hello, I’ve been trying to make a dash using body movers like LinearVelocity Or BodyVelocity (Also AssemblyLinearVelocity) but none of them work like I want. Basically they do not turn when you turn, what I mean by that is, the dash keeps going on the first assigned direction.

Here’s a video of what I mean; (Game is The Strongest Battlegrounds)
https://gyazo.com/905830c044c954882a5bba12308883d5

I am basically asking how I can accomplish this.

2 Likes

Apply a linearVelocity to the humanoidRootPart and constantly set it to the humanoidRootPart’s LookVector, and for simplicity’s sake just use uis to get keys, or if you really want to use humanoid.MoveDirection and do some math to figure out which direction the dash should go in.

Doesn’t seem to work, still goes in a predestined direction, I’ve made a code real quick to test;

local Character = script.Parent
local LineF = Instance.new("LinearVelocity",Character:FindFirstChild("HumanoidRootPart"))
local Attc = Instance.new("Attachment",Character:FindFirstChild("HumanoidRootPart"))
task.wait(2)
LineF.Attachment0 = Attc
LineF.ForceLimitsEnabled = false
local HRP = Character:FindFirstChild("HumanoidRootPart")
for i = 0,50 do
LineF.VectorVelocity = HRP.CFrame.LookVector * 50
end

I made this really fast so probably im missing something but even after tweaking around with the forces etc. it didn’t work.

I’m so sorry I meant to say BodyVelocity, I was testing linear velocity’s when I posted my comment so I just mistook the two. also for BodyVelocity It would be something like this.

local bv = Instance.new("BodyVelocity",hrp)
bv.MaxForce = Vector3.new(100000,0,100000)
bv.P = 1750

local movementConnection = run.RenderStepped:Connect(function()
	bv.Velocity = hrp.CFrame.LookVector * 50
end)

bv.Destroying:Connect(function()
	movementConnection:Disconnect()
end)

game.Debris:AddItem(bv,1.1)

also this is just my own way of handling this, you could also do for loops like you did with the linear velocity

1 Like

Thanks for the response.

EDIT: Just a heads up for anyone that wants to achive the same, BodyVelocity is old and deprecated, I would suggest using the new body movers. (With those you don’t have to update the velocity every frame too, since the attachment you will put in for the force will always be the same orientation relative to the RootPart.)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.