ZepetoCharacter
ZEPETO.Character.Controller.ZepetoCharacter
Represents a ZEPETO character that can be loaded and controlled in a ZEPETO World.
Hierarchy
↳
ZepetoCharacter
Constructors
constructor
• new ZepetoCharacter()
Inherited from
UnityEngine.MonoBehaviour.constructor
Properties
OnChangedState
• OnChangedState: UnityEvent$2
<CharacterState
, CharacterState
>
Event triggered when the character state changes. Registered listeners receive two parameters:
- The new character state. (Type:
CharacterState
) - The previous character state. (Type:
CharacterState
)
OnUpdateState
• OnUpdateState: UnityEvent$1
<CharacterState
>
Event triggered when the character state is in the status of StateStatus.Update
.
Registered listeners receive a single parameter:
- The current character state. (Type:
CharacterState
)
additionalJumpPower
• additionalJumpPower: number
Retrieves the additional jump power.
additionalRunSpeed
• additionalRunSpeed: number
Retrieves the additional run speed.
additionalWalkSpeed
• additionalWalkSpeed: number
Retrieves the additional walk speed.
constraintRotation
• constraintRotation: boolean
Determines whether the character's rotation is restricted.
Accessors
Context
• get
Context(): ZepetoContext
ZEPETO Context of the character.
Returns
ZepetoContext
CurrentState
• get
CurrentState(): CharacterState
Current state of the character defined in the state machine.
Returns
CurrentStateStatus
• get
CurrentStateStatus(): StateStatus
Status of the current state of the character, defined in the state machine.
Returns
ElapsedTime
• get
ElapsedTime(): number
Time elapsed in seconds since the character was initialized.
Returns
number
JumpPower
• get
JumpPower(): number
Retrieves the total jumping power, which is the sum of the base power and additional power.
Returns
number
MotionV2
• MotionV2: Object
RunSpeed
• get
RunSpeed(): number
Retrieves the total running speed, which is the sum of the base speed and additional speed.
Returns
number
StateMachine
• get
StateMachine(): CharacterStateMachine
State machine of the character.
Returns
StateMachineVersion
• StateMachineVersion: Object
WalkSpeed
• get
WalkSpeed(): number
Retrieves the total walking speed, which is the sum of the base speed and additional speed.
Returns
number
ZepetoAnimator
• get
ZepetoAnimator(): Animator
The animator for the ZEPETO character.
Returns
baseJumpPower
• get
baseJumpPower(): number
Retrieves the base jump power.
Returns
number
baseRunSpeed
• get
baseRunSpeed(): number
Retrieves the base running speed.
Returns
number
baseWalkSpeed
• get
baseWalkSpeed(): number
Retrieves the base walking speed.
Returns
number
characterController
• characterController: Object
loadingStatus
• get
loadingStatus(): LoadingStatus
Loading status of the character.
Returns
LoadingStatus
motionState
• get
motionState(): MotionState
Motion state and configuration of the character.
Returns
tryDoubleJump
• get
tryDoubleJump(): boolean
Indicates whether the character is attempting to double jump.
Returns
boolean
tryJump
• get
tryJump(): boolean
Indicates whether the character is attempting to jump.
Returns
boolean
tryMove
• get
tryMove(): boolean
Indicates whether the character is attempting to move.
Returns
boolean
Methods
CancelGesture
▸ CancelGesture(): void
Stops the playback of the gesture.
Returns
void
ChangeStateAnimation
▸ ChangeStateAnimation($state
): void
Plays the animation associated with the provided character state on the animator.
Parameters
Name | Type | Description |
---|---|---|
$state | CharacterState | Character state representing the animation to play. |
Returns
void
▸ ChangeStateAnimation($state
, $moveState
): void
Plays the animation associated with the provided character state on the animator.
Parameters
Name | Type | Description |
---|---|---|
$state | CharacterState | Character state representing the animation to play. |
$moveState | CharacterMoveState | Optional movement state for the animation when state is CharacterState.Move . |
Returns
void
▸ ChangeStateAnimation($state
, $jumpState
): void
Plays the animation associated with the provided character state on the animator.
Parameters
Name | Type | Description |
---|---|---|
$state | CharacterState | Character state representing the animation to play. |
$jumpState | CharacterJumpState | Optional jump state for the animation when state is CharacterState.Jump . |
Returns
void
▸ ChangeStateAnimation($state
, $landingState
): void
Plays the animation associated with the provided character state on the animator.
Parameters
Name | Type | Description |
---|---|---|
$state | CharacterState | Character state representing the animation to play. |
$landingState | CharacterLandingState | Optional landing state for the animation when state is CharacterState.Landing . |
Returns
void
DeformDefaultCostume
▸ DeformDefaultCostume(): void
Removes the body deformation items worn by the character, reverts to the default body shape, and applies the default ZEPETO outfit.
Returns
void
DeformDefaultProperties
▸ DeformDefaultProperties(): void
Removes the body deformation items worn by the character and reverts to the default body shape.
Returns
void
DoubleJump
▸ DoubleJump(): void
Makes the character double jump.
Returns
void
GetBodyModifierProperties
▸ GetBodyModifierProperties(): ZepetoPropertyFlag
[]
Retrieves the character properties associated with any body deformation items worn by the character.
Returns
ZepetoPropertyFlag
[]
Character properties associated with the body deformation items worn by the character.
GetSocket
▸ GetSocket($socket
): Transform
Retrieves the Transform
of a socket of the character.
Parameters
Name | Type | Description |
---|---|---|
$socket | HEAD_UPPER | Socket (Attachment point). |
Returns
Transform
component associated with the specified socket.
▸ GetSocket($socket
): Transform
Retrieves the Transform
of a socket of the character.
Parameters
Name | Type | Description |
---|---|---|
$socket | string | Name of the socket (attachment point). |
Returns
Transform
component associated with the specified socket.
Jump
▸ Jump(): void
Makes the character jump.
Returns
void
Move
▸ Move($dir
): void
Moves the character in a specified direction.
Parameters
Name | Type | Description |
---|---|---|
$dir | Vector2 | Direction in which the character should move. |
Returns
void
▸ Move($dir
): void
Moves the character in a specified direction.
Parameters
Name | Type | Description |
---|---|---|
$dir | Vector3 | Direction in which the character should move. |
Returns
void
MoveContinuously
▸ MoveContinuously($dir
): void
Continuously moves the character in a given direction based on the current orientation it is facing.
Parameters
Name | Type | Description |
---|---|---|
$dir | Vector2 | Direction in which the character should move, based on the current orientation it is facing. |
Returns
void
▸ MoveContinuously($dir
): void
Continuously moves the character in a given direction based on the current orientation it is facing.
Parameters
Name | Type | Description |
---|---|---|
$dir | Vector3 | Direction in which the character should move, based on the current orientation it is facing. |
Returns
void
MoveToPosition
▸ MoveToPosition($pos
): void
Moves the character to a specified position.
Parameters
Name | Type | Description |
---|---|---|
$pos | Vector3 | Destination the character should move to. |
Returns
void
SetGesture
▸ SetGesture($gesture
): void
Plays the character's motion for the specified gesture.
Parameters
Name | Type | Description |
---|---|---|
$gesture | AnimationClip | Gesture that the character will perform. |
Returns
void
StopMoving
▸ StopMoving(): void
Stops the character's movement.
Returns
void
SyncStateAnimation
▸ SyncStateAnimation(): void
Synchronizes the animator with the current character state of the ZEPETO character.
Returns
void
Teleport
▸ Teleport($pos
, $rot
): void
Instantly moves the character to the specified transform.
Parameters
Name | Type | Description |
---|---|---|
$pos | Vector3 | Position to which the character will be teleported. |
$rot | Quaternion | Rotation that the character will have after the teleportation. |
Returns
void
add_loadedCharacter
▸ add_loadedCharacter($value
): void
Adds a callback function to handle the completion of character loading.
Parameters
Name | Type |
---|---|
$value | Action |
Returns
void
remove_loadedCharacter
▸ remove_loadedCharacter($value
): void
Removes a callback function to handle the completion of character loading.
Parameters
Name | Type |
---|---|
$value | Action |
Returns
void