Camera
Where the Camera object is found
In an instance of the game, each client has its own Camera object associated with it. Camera objects exist only upon the viewer’s client, residing in that user’s local Workspace, and therefore cannot be edited directly from the server.
Each client’s particular Camera object can be accessed through the Workspace.CurrentCamera
property of the Workspace
on that client.
Note, Workspace.CurrentCamera
can also be used to find the Camera object in Roblox Studio.
How the Camera object works
The Camera’s properties define the current view of the 3D game world. The most important of these being:
The
Camera.CFrame
property represents the position and orientation of the camera.The
Camera.Focus
property represents the point the camera is looking at. It is important this property is set as it also represents where the game thinks you are in the world. Certain visuals will be more detailed and will update more frequently, depending on how close they are to the Focus. Roblox’s default camera scripts take care of this.The
Camera.CameraType
property is read by the game’s camera scripts and determines how the Camera should update each frame.The
Camera.CameraSubject
property is read by the game’s camera scripts and determines what object the Camera should follow.The
Camera.FieldOfView
property represents the extent of the observable world visible.
How to work with the Camera
Roblox’s camera scripts update the Camera’s properties every frame dependent on the current Camera.CameraType
. This means developers looking to control the Camera themselves have two options.
Setting the
Camera.CameraType
property to ‘Scriptable’. When the Camera is in ‘Scriptable’ mode the default camera scripts will not update the camera. In most cases this is the easiest option.Replacing or modifying the default camera scripts in
StarterPlayer.StarterPlayerScripts
. This is only recommended for advanced developers.
Properties
Specifies the CameraType
to be read by the camera scripts
Determines the FOV value of the Camera
that’s invariant under viewport size changes.
Sets the area in 3D space that is prioritized by Roblox’s graphical systems
Sets the scale of the user’s head when using VR
Vector2
[readonly]
[notreplicated]
Describes the dimensions, in pixels, of the client’s viewport
Last updated