How to make a character dash in the exact direction they're moving in?

Hello,
I’m trying to make a dash move that dashes your character in the exact direction they’re walking in (like a mobile player’s joystick direction), however I’m having a lot of difficulty trying to figure it out.

I’ve tried to research this but I’ve gotten no helpful information

        local BV = Instance.new("BodyVelocity",char.HumanoidRootPart)
		BV.MaxForce = Vector3.new(100000,0,100000)
		BV.Velocity = char.HumanoidRootPart.CFrame:VectorToObjectSpace(char.HumanoidRootPart.Velocity) * 42

try using ApplyImpulse in the lookvector of the humrootpart

the thing is, I don’t want it to dash where your character is facing (I already know how to do that). I’m trying to figure out how to make it dash in the direction your character is moving

I’m not sure if this is exactly what you’re looking for, but try humanoid.MoveDirection.
https://developer.roblox.com/en-us/api-reference/property/Humanoid/MoveDirection

I’ve tried using MoveDirection before, but it didn’t work. The reason was because I used it in the wrong way; I tried making the character move in the direction of a CFrame facing the movedirection coordinates.

Why didn’t I ever think of using MoveDirection this way:

       local force = 42

		if char.Humanoid.MoveDirection ~= Vector3.new(0,0,0) then
			BV.Velocity = char.Humanoid.MoveDirection * force
		else
			BV.Velocity = char.HumanoidRootPart.CFrame.LookVector * force
		end