Argument 3 missing or nil

I am trying to rotate a camera, but it just writes Argument 3 missing or nil…

local UIS = game:GetService("UserInputService")
local Body = workspace["DAF XF"].Body
local Camera = workspace.Camera

	if input.KeyCode == Enum.KeyCode.One then
		Camera.CameraType = Enum.CameraType.Scriptable

		while Camera.CameraType == Enum.CameraType.Scriptable do
			local pos =, Body.Parent.DriveSeat.Position.Y + 3, Body.Parent.DriveSeat.Position.Z)
			local y = Body.Parent.DriveSeat.Orientation.Y - 7
			local x = Body.Parent.DriveSeat.Orientation.X - 0
			local z = Body.Parent.DriveSeat.Orientation.Z - 0
			Camera.CFrame =,, y, 0))),, 0, 0))),, 0, z))))

Which line is it saying has the error?

It says line 15, can you paste line 15, so I know exactly which line that is?

Camera.CFrame =,, y, 0))),, 0, 0))),, 0, z))))v

Why are you passing a CFrame into a Vector3, that’s passing a Vector3 into the CFrame?

CFrame.Angles takes 3 radian values, not a Vector3

And passing a Vector3 into a CFrame only takes into consideration the X, Y, and Z coordinates (unless the constructor does otherwise), so your Vector3s would just become, 0, 0) since CFrame.Angles only creates a blank CFrame with modified rotational values

Ok hi again um you could just do * CFrame.Angles(math.rad(x),math.rad(y),math.rad(z))

3 Likes, 0, 0)))

needs to have x,y,z not a

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