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 Bitmoji | Camera Controller with a generic object |
---|---|
Key Features
The Camera Controller component provides three distinct camera behaviors:
- Follow Mode - Camera tracks a target object's position with optional axis locking
- Third-Person Mode - Automatically follows a character and rotates toward character direction
- Orbit Mode - Allows free rotation around a target with touch controls
Usage

- Locate the Camera Controller custom component in the Asset Library.
- Click the Install button to add it to your project. Once installed, the component can be attached to a Scene Object.
- Set the Camera Input to the Camera Object you want to control and select the
Camera Mode
you wish to use. - Set the
Follow Target
to the Scene Object you want the Camera to track. - Customize the camera behavior by adjusting the
Smoothing Factor
,Offset
andLock 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
Name | Type | Description |
---|---|---|
camera | SceneObject | The camera object this script will control. |
cameraMode | string | Initial camera mode. One of "Orbit" , "Third Person" , "Follow" . |
followTarget | SceneObject | Scene Object that the camera will track / follow. |
printLogs | boolean | If true warnings will be printed to the logger. |
smoothingFactor | number | Controls how smoothly the camera follows its target (higher = smoother), min 0 – max 1. |
radius (Orbit Camera Mode) | number | Distance from target to camera (Orbit mode). |
orbitSpeed (Orbit Camera Mode) | number | Controls 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) | boolean | If enabled, the camera will continuously orbit around the target. |
verticalClamp (Orbit Camera Mode) | vec3 | Limits how far up/down the camera can rotate. Format: (min, max, default) . |
horizontalClamp (Orbit Camera Mode) | vec3 | Limits how far left/right the camera can rotate. Format: (min, max, default) . |
interactiveArea (Orbit Camera Mode) | InteractionComponent | Touchable screen region for swipe / gesture control. If null, the whole screen is interactive. |
positionOffset (Follow & Third Person modes) | vec3 | Offset from target (Follow & Third Person modes). |
rotationOffset (Third Person mode) | vec3 | Additional rotation offset (Third Person mode). |
lockX (Follow mode) | boolean | Restricts camera from moving / rotating along the X axis (Follow mode). |
lockY (Follow mode) | boolean | Restricts camera from moving / rotating along the Y axis (Follow mode). |
lockZ (Follow mode) | boolean | Restricts camera from moving / rotating along the Z axis (Follow mode). |
Component API
Name | Description |
---|---|
camera : SceneObject | Gets / sets the SceneObject the component drives. |
followTarget : SceneObject | Gets / 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) : void | Switches the component to Follow mode using the supplied configuration (copied internally). |
enableThirdPersonCameraMode(config: ThirdPersonCameraModeConfig) : void | Switches the component to Third Person mode using the supplied configuration (copied internally). |
enableOrbitCameraMode(config: OrbitCameraModeConfig) : void | Switches the component to Orbit mode using the supplied configuration (copied internally). |
resetPosition() : void | Instantly moves the camera to its final position (without smoothing). It is useful after switching modes. |
printLogs : boolean | Gets / sets log printing flag. |
Testing on Device
To preview your Lens in Snapchat, follow the Pairing to Snapchat guide.