Skip to main content
Version: 5.x
Supported on
Snapchat
Camera Kit Android
This feature may have limited compatibility and may not perform optimally.
Camera Kit iOS
This feature may have limited compatibility and may not perform optimally.
Camera Kit Web
This feature may have limited compatibility and may not perform optimally.

Camera Controller

A modular and customizable system for managing camera behavior. This component includes multiple presets such as third-person, follow, and orbit modes, allowing developers to fine-tune camera positioning, movement, and responsiveness for a wide range of gaming experiences and interactive Lens formats.

Camera Controller with a BitmojiCamera Controller with a generic object

Key Features

The Camera Controller component provides three distinct camera behaviors:

  1. Follow Mode - Camera tracks a target object's position with optional axis locking
  2. Third-Person Mode - Automatically follows a character and rotates toward character direction
  3. Orbit Mode - Allows free rotation around a target with touch controls

Usage

  1. Locate the Camera Controller custom component in the Asset Library.
  2. Click the Install button to add it to your project. Once installed, the component can be attached to a Scene Object.
  3. Set the Camera Input to the Camera Object you want to control and select the Camera Mode you wish to use.
  4. Set the Follow Target to the Scene Object you want the Camera to track.
  5. Customize the camera behavior by adjusting the Smoothing Factor, Offset and Lock Axis settings.

Camera Modes

Follow Mode


The camera tracks the Follow Target's position while maintaining its current orientation. Ideal for side-scrolling games or situations where you want the camera to move but not rotate.

Features:

  • Tracks target position only
  • Maintains camera's original rotation
  • Supports axis locking for 2D-style movement
  • Configurable smoothing for natural movement

Third Person Mode


Automatically follows a character and rotates toward the character's direction. Perfect for third-person adventure games, character showcases, and exploration experiences.

Features:

  • Follows target position and rotation
  • Maintains consistent distance from target
  • Smooth interpolation for natural camera movement
  • Works seamlessly with Character Controller component

Usage with Character Controller: To use Third Person Mode with a character, attach the Camera Controller component to your camera and set the Follow Target to the Scene Object that has the Character Controller component attached. The camera will automatically follow the character's movement and rotate to face the direction the character is moving.

Camera Placement: When using Third Person Mode, make sure to position your camera behind the character in the scene. The camera will maintain this relative position and distance as it follows the character.

Orbit Mode


Allows free rotation around a target using touch controls. Users can tap and drag within a specified Interactive Area to orbit the camera around the Follow Target, ideal for interactive 3D object viewers and third person games.

Features:

  • Touch-controlled camera rotation
  • Configurable interaction area
  • Automatic orbit option for hands-free rotation
  • Vertical and horizontal rotation clamping
  • Adjustable orbit speed

Camera Mode Selection:

  • Use Follow for side-scrolling or platform games
  • Use Third Person for character-based adventure games
  • Use Orbit for interactive 3D showcases and object viewers

Component Inputs

NameTypeDescription
cameraSceneObjectThe camera object this script will control.
cameraModestringInitial camera mode. One of "Orbit", "Third Person", "Follow".
followTargetSceneObjectScene Object that the camera will track / follow.
printLogsbooleanIf true warnings will be printed to the logger.
smoothingFactornumberControls how smoothly the camera follows its target (higher = smoother), min 0 – max 1.
radius (Orbit Camera Mode)numberDistance from target to camera (Orbit mode).
orbitSpeed (Orbit Camera Mode)numberControls how fast the camera rotates around the target. Orbit speed sign defines direction of camera movement for auto orbit (if it is > 0 is moves anticlockwise, if < 0 - clockwise).
autoOrbit (Orbit Camera Mode)booleanIf enabled, the camera will continuously orbit around the target.
verticalClamp (Orbit Camera Mode)vec3Limits how far up/down the camera can rotate. Format: (min, max, default).
horizontalClamp (Orbit Camera Mode)vec3Limits how far left/right the camera can rotate. Format: (min, max, default).
interactiveArea (Orbit Camera Mode)InteractionComponentTouchable screen region for swipe / gesture control. If null, the whole screen is interactive.
positionOffset (Follow & Third Person modes)vec3Offset from target (Follow & Third Person modes).
rotationOffset (Third Person mode)vec3Additional rotation offset (Third Person mode).
lockX (Follow mode)booleanRestricts camera from moving / rotating along the X axis (Follow mode).
lockY (Follow mode)booleanRestricts camera from moving / rotating along the Y axis (Follow mode).
lockZ (Follow mode)booleanRestricts camera from moving / rotating along the Z axis (Follow mode).

Component API

NameDescription
camera: SceneObjectGets / sets the SceneObject the component drives.
followTarget: SceneObjectGets / sets the SceneObject the camera follows.
cameraMode: CameraMode(readonly) Returns the currently active camera mode: "Orbit", "Third Person", or "Follow".
followModeConfig: FollowCameraModeConfig(readonly) Returns configuration instance used by the Follow camera mode.
thirdPersonCameraModeConfig: ThirdPersonCameraModeConfig(readonly) Returns configuration instance used by the Third Person camera mode.
orbitCameraModeConfig: OrbitCameraModeConfig(readonly) Returns configuration instance used by the Orbit camera mode.
enableFollowCameraMode(config: FollowCameraModeConfig): voidSwitches the component to Follow mode using the supplied configuration (copied internally).
enableThirdPersonCameraMode(config: ThirdPersonCameraModeConfig): voidSwitches the component to Third Person mode using the supplied configuration (copied internally).
enableOrbitCameraMode(config: OrbitCameraModeConfig): voidSwitches the component to Orbit mode using the supplied configuration (copied internally).
resetPosition(): voidInstantly moves the camera to its final position (without smoothing). It is useful after switching modes.
printLogs: booleanGets / sets log printing flag.

Testing on Device

To preview your Lens in Snapchat, follow the Pairing to Snapchat guide.

Was this page helpful?
Yes
No