Multiplying the lookvector with a vector3 doesn't work

If I multiply this part’s CFrame.LookVector by a velocity, it does not work and in stead only affects the X axis.

local LookVector = script.Parent.CFrame.LookVector
local Velocity = LookVector * Vector3.new(10000,0,0)

When I print the velocity, my output is

-3826.83447, 0, -0

Anyone please help.

Multiplying a Vector3 by another Vector3 will multiply each of the axes individually. Essentially:

v1 * v2 == v1.X * v2.X, v1.Y * v2.Y, v1.Z * v2.Z

My guess is that you want to scale it instead. To do that, just multiply it with one number:

v1 * number

Or in your case:

local LookVector = script.Parent.CFrame.LookVector
local Velocity = LookVector * 10000
1 Like

Multiplying it by 10000 seems to change it’s axis, this shouldn’t happen and is very weird.
My output prints out the following velocity,

-38.2683449, 92.3879471, -0

What exactly are you trying to accomplish? And could you share some more code so we could get a better sense of that?

Crazyman’s answer is the correct way to get a higher velocity of a vector (the look vector in this case). Your implementation or original LookVector may be flawed or not what you expect. Would you provide more context into:

  1. Have you verified the LookVector of the part you’re firing from actually faces the right direction?
  2. How are you implementing the movement exactly?

Right now it seems your current LookVector (after dividing it by 10000 again) is almost 0,0,0. Which is why the part would go to the origin where it currently appears to be moving towards.

1 Like

I just fixed this, apparently the front direction was on the up side of the part, like @MrNicNac said.
I fixed this by simply multiplying the CFrame of the part by 90 degrees on the Z axis.
What I was trying to accomplish is make a bullet move.