How to make BodyVelocity move the player to the side?

I am making a dash system where you dash forward, backward, left or right, depending on if you’re pressing w, a, s, or d. Forward and backward dashing work, but I can’t figure out how to get the player to go side to side. I am using body velocity.

local HumanoidRootPart = Character.HumanoidRootPart
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.MaxForce = Vector3.new(math.huge, 0, math.huge)
BodyVelocity.Velocity = HumanoidRootPart.CFrame.LookVector * 100
BodyVelocity.Parent = HumanoidRootPart
task.wait(.3)
BodyVelocity:Destroy()

if anyone knows how to do this I would appreciate it.

If you want the player to go side to side, you would use CFrame.RightVector

CFrame.RightVector → To the right
-CFrame.RightVector → To the left

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