How would I accomplish this?

Lets say I have a brick. And lets say that the brick is moving along it’s lookvector, and it’s right vector. My question is, how can I detect the brick’s velocity along the right vector?

If you don’t understand my question, then please tell me!

1 Like

The scalar projection of the velocity onto the right vector gives the velocity in that particular direction. This is brick.Velocity:Dot(brick.CFrame.RightVector)

5 Likes

You can find a part’s velocity with part.Velocity, it will return a vector3 value.

The OP is asking how to calculate the velocity component with respect to the RightVector. To do so, he needs to perform a projection of velocity onto the right vector, as 1waffle1 stated. Using Dot product will essentially perform the projection, and then give you the magnitude of the projected vector. While it’s good that you are trying to help OP, please read his question thoroughly before responding.

3 Likes

Can I calculate the velocity opposite from the right vector? For example, the Left Vector? I’m assuming you would do this by adding the negative sign in front of brick.CFrame.RightVector so then the whole line of code would look like this: brick.Velocity:Dot(-brick.CFrame.RightVector)

Yes. The LeftVector is simply the negative vector of the RightVector. Your code is essentially performing the projection and getting the magnitude of the vector projected onto the LeftVector.