Every time I set a variable, the output returns a error; Vector3 expected, got number.

How would I be able to make a Vector3 and not a Number? Not seeing the problem, but hopefully you can.

Here are some lines of code that it errors on:

camera.speed = math.min(20, math.max(camera.speed * 0.88 + char.HumanoidRootPart.Velocity * Vector3.new(1, 0, 1).magnitude * 0.14, -20))
local uDistance = head.CFrame.p - uPos.magnitude - camera.ZIndexOffset

I honestly don't know why the error is there, HELP!

3 comments

0

Are you setting the variable properly? make sure you create a vector3 when setting a new vector3, like local position=Vector3.new(0,1,0)

0

What exactly are you trying to accomplish here? What is the intended output?

0

What is the error? We dont know what is wrong without the error!