BodyVelocity Corresponding to LookVector

Hello :smile:,

@Water_KKnight here,

I’m trying to create a BodyVelocity with a diagonal force (Vector3) from the HumanoidRootPart’s LookVector.

I’ve tried applying LookVector + Vector3:

BodyVelocity.Velocity = Humrp.CFrame.lookVector + Vector3.new(40,40,0)

However, Vector3 is relative to 0,0,0. This makes the part’s bv go in a diagonal (x & y), but overrides the lookvector.

https://streamable.com/1i0zqa

The LookVector by itself (no diagonal, works as intended):

BodyVelocity.Velocity = Humrp.CFrame.lookVector * 40

I predict that this would be fairly simple, but I’m struggling with a direct solution to this problem.

I would appreciate any help! :pray:

2 Likes

Couldn’t you add the UpVector as well in relation to your LookVector position? :thinking: Should look something like this:

BodyVelocity.Velocity = (Humrp.CFrame.LookVector + Humrp.CFrame.UpVector) * 40
2 Likes

Thanks, @JackscarIitt.

I was completely unaware of UpVector. :slightly_smiling_face:

Ah you’re fine! Yeah CFrame has a lot of Positions to keep in mind of, such as:

  • The Classic CFrame.Position

  • LookVector

  • UpVector

  • RightVector (But apparently not Left)

2 Likes