cam = game.Workspace.CurrentCamera cam.CameraType = "Scriptable" cam.CoordinateFrame = CFrame.new(-15, 5, 2.5) cam.Focus=CFrame.new(20,3,2) wait()
Everything works except for the Focus. It doesn't do anything no matter how much I change it. Please help!
Simply put, setting Focus
when CameraType
is set to Scriptable
will do nothing. What you can do is make the camera's CoordinateFrame
start at one point while looking at another. To do this, you can use a built-in CFrame constructor:
CFrame.new(start, lookat)
Where start
is the position of the CFrame and lookat
is where the CFrame "looks" at. Both must be Vector3. To use this in your script, you would do something like this:
cam = game.Workspace.CurrentCamera cam.CameraType = "Scriptable" local start = Vector3.new(-15, 5, 2.5) local lookat = Vector3.new(20, 3, 2) cam.CoordinateFrame = CFrame.new(start, lookat) wait()