Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is it possible to zoom out the camera with a script?

1 answer

Intro

In order to edit the Camera, you must first place it into the Scriptable Camera Type

local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable

After this, you have two options to change the "zoom" of the camera Note you can only make these changes using a LocalScript

Option 1: FieldOfView

The Camera has a Property named FieldOfView which can be set to any number between 1 and 120 (1 being close to the target, 120 being zoomed out) This works in the same way as a magnifying glass would. Examples can be seen here

Option 2: CFrame

You can set the Camera's CFrame when in Scriptable Mode to be farther out than it normally is by changing the original CFrame to a part that is farther than the default

camera.CFrame = CFrame.new(origin.Position, target.Position)

In the above example, the "origin" is whatever part you want to be looking out from, and the target, is the part you want the camera to face.

It should be noted that the CFrame.new() will only take Vector3 arguments, which is why we use the Position Property

There's also other CFrame alterations you can make with properties seen here

This discussion is preserved as it was. New answers, comments, and votes are closed.