Dash based on camera

How do you create a dash dependant on where the camera is facing, rather than where the humanoidrootpart is? To elaborate, when the character is mid dash, the dash changes course depending on where the camera is facing.

Example of what I want to achieve:
dash

In the gif, it shows the characters dash direction changing because the camera is changing direction; how do you recreate this?

I don’t like using body velocities because when your character has momentum or is in the air the dash distance changes. At the moment i’m using bodyposition which always go to the same direction regardless of the camera.

Heres what I tried:

function Dasha(root)
	local camera = workspace.CurrentCamera
	local direction = camera.CFrame.RightVector * -25
	local bp = Instance.new('BodyPosition')
	bp.MaxForce = Vector3.new(30000,0,30000)
	bp.P = 100000
	bp.D = 2500
	bp.Parent = root
	bp.Position = Vector3.new(direction.X, 0, direction.Z)
	game.Debris:AddItem(bp, .18)
end

The script above tries to dash to the left, but simply goes into seemingly random directions each time.

I used this post for reference on the above script:

If you need another example please ask!