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
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.One then
Camera.CameraType = Enum.CameraType.Scriptable
while Camera.CameraType == Enum.CameraType.Scriptable do
local pos = Vector3.new(Body.Parent.DriveSeat.Position.X, 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
task.wait()
Camera.CFrame = CFrame.new(pos, Vector3.new(CFrame.Angles(Vector3.new(0, y, 0))), Vector3.new(CFrame.Angles(Vector3.new(x, 0, 0))), Vector3.new(CFrame.Angles(Vector3.new(0, 0, z))))
end
end
end)
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 Vector3.new(0, 0, 0) since CFrame.Angles only creates a blank CFrame with modified rotational values