How to make Body Velocity go left and right

Hello, I need help make this line go universal every time they go right the velocity will be the same even looking a different way like it still goes right even if looking a different way but it will not do that(i might be confusing)
bodypos.Velocity = HRP.CFrame.LookVector * 0 + Vector3.new(5,0,0)

Iā€™m not good at body velocity, but you can go to the property, find the velocity, and change the values of X and Z coordiantes. Positive X goes left(I think) and negative goes right.

So the thing I want to happen is that I climb a wall and I press d so I add (5,0,0) and when I do it on another side it went forward

Well your current code makes no sense as you are multiplying it by 0 to give you zero and then adding the vector.

You would want to do something like this if you want it to go to Right Object space wise

Velocity = HRP.CFrame.RightVector * 5 --5 being the magnitude you currently have

and you can simply negate the RightVector to give you the other direction

Velocity = -HRP.CFrame.RightVector * 5

is it possible to add instead of multiplying.

Adding will change the direction of the vector ( in most cases ). So just multiply it.

1 Like