Why is this Vector3 returning all 0's?

I’m trying to multiply 2 vector3’s together, but it just ends up returning
-0, 0, -0

I’m super confused as to my knowledge, this should function normally.

The VectorForce is made on the server, it’s just a Y value.

Here’s the script:

local character = script.Parent
local vectorForce = character:WaitForChild("HumanoidRootPart"):WaitForChild("VectorForce", 10)
local uis = game:GetService("UserInputService")

game:GetService("RunService").PreRender:Connect(function()
	--vectorForce.Force = vectorForce.Force * Vector3.new(workspace.CurrentCamera.CFrame.LookVector.X, 0, workspace.CurrentCamera.CFrame.LookVector.Z)
	
	print(Vector3.new(workspace.CurrentCamera.CFrame.LookVector.X, 0, workspace.CurrentCamera.CFrame.LookVector.Z) * vectorForce.Force)
end)

All help is greatly appreciated!

If it’s just a Y value, why not switch the ‘0’ to VectorForce.Force.Y
(I don’t understand position and cframe that well)

local lookVector = workspace.CurrentCamera.LookVector
print(Vector3.new(lookVector.X, vectorForce.Force.Y, lookVector.Z))
1 Like

This works, thank you!

Any idea why the * didn’t work though?

Vector3 * Vector3 actually multiplies.
CFrame * CFrame is probably object space translation.

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