My camera looks in weird spots?

local function CamCFrame(position, lookAt)
	local lookVector = (position - lookAt).Unit 
    local modelUpVector = Vector3.new(0, 1, 0)
    local rightVector = lookVector:Cross(modelUpVector)
    local upVector = rightVector:Cross(lookVector)

    return CFrame.fromMatrix(position, rightVector, upVector)

end
local camera = workspace.CurrentCamera
game.Players.LocalPlayer.CharacterAdded:Wait()
local character = game.Players.LocalPlayer.Character
workspace.House1.Door.ClickDetector.MouseClick:Connect(function()
	camera.CameraType = Enum.CameraType.Scriptable
repeat wait(0.01)
    camera.CFrame = CamCFrame(character.HumanoidRootPart.Position + Vector3.new(-1,-10,-10), character.HumanoidRootPart.Position)
until camera.CameraType == Enum.CameraType.Follow
end)
game.ReplicatedStorage.Folder.resetCameraAngle.OnClientEvent:Connect(function()
	camera.CameraType = Enum.CameraType.Follow
end)

This script works fine, but the camera always looks in weird spots.
I don’t know why, but if I set it to (-1, 90, 0) it will look from the bottom and (-1, -10, -10) is the closest I can get to the angle I want.
The function is from one of the community tutorials.

Do you want it to look at a Vector3 value?

It’s this:
Position:
character.HumanoidRootPart.Position + Vector3.new(-1,-10,-10)
LookAt:
character.HumanoidRootPart.Position

Or should I do CFrame instead? Will the game think I’m looking at the coordiantes instead of the CFrame?

Oh, you would do that by setting the cam cframe to: CFrame.new(character.HumanoidRootPart.Position+Vector3.new(-1,-10,-10),character.HumanoidRootPart.Position).

Your lookVector should be (lookAt-position).Unit, you have yours flipped

I don’t want to use this as it is deprecated. I want to use CFrame.FromMatrix() instead.

Then you could look at @wow13524 reply.