I'm making a developer-only aimbot script for my own game so that devs can have special powers. I have this code:
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame=
CFrame.new(camera.CFrame.Position,closestPlayer.Character.Head.Position)
The end result is something weird and hard to explain and it just doesn't work. I want to know how to make it so that I am in first person and the middle of my screen is locked on to the player's head but I can move around normally. Thanks in advance!

1 comment
use the Z coordinate