PcoWSkbVqDnWTu_dm2ix

Camera Manipulation

Camera Manipulation

15 min

Beyond basic articles/customizing the camera|camera customization, you can manipulate the game camera to create specific player/character view systems, lock the camera to a world position, create unique camera effects, and more.

Camera Properties

The Roblox Camera has several built-in properties, including:

Property Description
Camera/CFrame The BasePart/CFrame|CFrame of the camera. This property is frequently used to position and move the camera in game.
Camera/Focus The point in 3D space where the camera is looking. When pointing the camera in a specific direction, you should update this property because certain visuals will be more detailed depending on how close they are to the focus point.
Camera/FieldOfView The extent of the observable game world that can be seen on screen, measured between 1–120 degrees in the vertical direction (default is 70).

Scripting the Camera

Inside scripts, the game camera can be accessed with the Workspace/CurrentCamera|CurrentCamera object:

Over-the-Shoulder

A basic over-the-shoulder camera, commonly found in third-person shooter games, can be achieved with the following script. This camera stays locked behind the character’s back and players use the mouse to turn (not directional input).

Scope In/Out

A simple scope in/out camera system can be implemented using the following script. This example uses the middle mouse button to zoom in and out, and the ability of ContextActionService to create a virtual zoom button on mobile devices.

Rotate Around Object

To rotate the camera fully or partially around a part, experiment with the following script which features adjustable camera offset, rotation time, repetition count, easing styles, and more.

Side-Scroller

A typical side-scrolling camera system can be implemented using the following script. This example locks the camera to the X plane at an adjustable Z offset from the player.

Tags:
  • camera
  • view
  • control