Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help With Cam Focus?

Asked by
Scootakip 299 Moderation Voter
8 years ago
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!

1 answer

Log in to vote
0
Answered by
XAXA 1569 Moderation Voter
8 years ago

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()
Ad

Answer this question