Skip to main content

ZepetoCamera

ZEPETO.Character.Controller.ZepetoCamera

Camera control class designed for use within a ZEPETO Character Controller.

Hierarchy

Constructors

constructor

new ZepetoCamera()

Inherited from

UnityEngine.MonoBehaviour.constructor

Properties

OnChangedState

OnChangedState: UnityEvent$2<CameraState, CameraState>

Event triggered when the camera state changes. Registered listeners receive two parameters:

  • The new camera state. (Type: CameraState)
  • The previous camera state. (Type: CameraState)

OnUpdateState

OnUpdateState: UnityEvent$1<CameraState>

Event triggered when the current camera state is in the status of StateStatus.Update. Registered listeners receive a single parameter:

  • The current camera state. (Type: CameraState)

additionalMaxZoomDistance

additionalMaxZoomDistance: number

Extra distance added to the default maximum zoom value.


additionalMinZoomDistance

additionalMinZoomDistance: number

Extra distance added to the default minimum zoom value.


additionalOffset

additionalOffset: Vector3

Additional offset applied to the camera's position relative to its target.

Accessors

CollisionLayer

get CollisionLayer(): LayerMask

Defines the layers with which the camera can collide.

Returns

LayerMask

set CollisionLayer(value): void

Defines the layers with which the camera can collide.

Parameters

NameType
valueLayerMask

Returns

void


FollowTarget

get FollowTarget(): Transform

Retrieves the Transform of the target. By default, this is set to be the HEAD_UPPER of the local player's character.

Returns

Transform


LockXAxis

get LockXAxis(): boolean

Indicates whether the camera's X-axis rotation is locked.

Returns

boolean

set LockXAxis(value): void

Indicates whether the camera's X-axis rotation is locked.

Parameters

NameType
valueboolean

Returns

void


LookOffset

get LookOffset(): Vector3

Calculated offset of the camera from its target.

Returns

Vector3


MaxZoomDistance

get MaxZoomDistance(): number

Calculated maximum distance the camera can zoom out from the target.

Returns

number


MinZoomDistance

get MinZoomDistance(): number

Calculated minimum distance the camera can zoom in towards the target.

Returns

number


Sensitivity

Sensitivity: Object


Speed

Speed: Object


StateMachine

get StateMachine(): StateMachine$1<CameraState>

Retrieves the camera state machine.

Returns

StateMachine$1<CameraState>


camera

get camera(): Camera

Unity Camera.

Returns

Camera


cameraParent

get cameraParent(): Transform

Transform of the camera parent object.

Returns

Transform


currentState

get currentState(): CameraState

Retrieves the current camera state.

Returns

CameraState


currentStateStatus

get currentStateStatus(): StateStatus

Retrieves the status of the current camera state.

Returns

StateStatus


distance

get distance(): number

Distance from the target.

Returns

number


isFollow

get isFollow(): boolean

Retrieves the flag indicating whether the camera is following the target.

Returns

boolean


position

get position(): Vector3

Retrieves the current camera position value.

Returns

Vector3


rotation

get rotation(): Quaternion

Retrieves the current camera rotation value.

Returns

Quaternion


rotationDampSpeed

get rotationDampSpeed(): number

Interpolation speed for rotation.

Returns

number

set rotationDampSpeed(value): void

Interpolation speed for rotation.

Parameters

NameType
valuenumber

Returns

void


rotationSpeed

get rotationSpeed(): number

Speed of rotation.

Returns

number

set rotationSpeed(value): void

Speed of rotation.

Parameters

NameType
valuenumber

Returns

void


targetScaleWeight

get targetScaleWeight(): number

Weight applied to the target's scale to adjust the camera's position and behavior.

Returns

number

set targetScaleWeight(value): void

Weight applied to the target's scale to adjust the camera's position and behavior.

Parameters

NameType
valuenumber

Returns

void


useCharacterCulling

get useCharacterCulling(): boolean

Indicates whether to enable character culling to prevent rendering issues at close camera distances.

Returns

boolean

set useCharacterCulling(value): void

Indicates whether to enable character culling to prevent rendering issues at close camera distances.

Parameters

NameType
valueboolean

Returns

void


useEnhancedOption

useEnhancedOption: Object


zoomDampSpeed

get zoomDampSpeed(): number

Interpolation speed for zooming in and out.

Returns

number

set zoomDampSpeed(value): void

Interpolation speed for zooming in and out.

Parameters

NameType
valuenumber

Returns

void


zoomSpeed

get zoomSpeed(): number

Speed of zooming in and out.

Returns

number

set zoomSpeed(value): void

Speed of zooming in and out.

Parameters

NameType
valuenumber

Returns

void

Methods

DoZoom

DoZoom($delta): void

Zooms the camera.

Parameters

NameTypeDescription
$deltanumberZoom amount.

Returns

void


Rotate

Rotate($delta): void

Rotates the camera.

Parameters

NameTypeDescription
$deltaVector2Roate amount.

Returns

void


SetFollowTarget

SetFollowTarget($target, $scaleReference?): void

Sets the follow target for the camera.

Parameters

NameTypeDescription
$targetTransformTransform representing the object that the camera should follow.
$scaleReference?TransformOptional Transform used as a reference for scaling the camera's follow behavior. If provided, the camera will adjust its distance towards the target based on the scale of this reference.

Returns

void


Create

Static Create($camera, $data): ZepetoCamera

Creates a ZepetoCamera instance.

Parameters

NameTypeDescription
$cameraCameraUnity Camera object to be used as the basis for the ZepetoCamera.
$dataCameraDataInitial configuration for the ZepetoCamera.

Returns

ZepetoCamera

New instance of ZepetoCamera.