Implemented in com.para.services
Not creatable:You can not create a object of this class.
Description
You can use the ParaPlayer class to control the behaviors of characters in a World and get data on these characters. Each player's character is associated with a ParaPlayer object. When a player's character joins, leaves, or respawns, the OnPlayerJoined, OnPlayerLeft, or OnPlayerRespawn event will be triggered. You can listen to such events in the Lua script associated with ParaScript.
Properties
displayName | Username of the ParaPlayer |
gameObject | GameObject object associated with the ParaPlayer |
isLocal | Determines whether the player is a local player. |
isMaster | Determines whether the player is the master of the current room. |
isRoomCreator | Determines whether the player is the creator of the current room. |
playerID | Unique ID of the ParaPlayer in the room |
position | World position of the ParaPlayer |
rotation | World orientation of the ParaPlayer |
UID | Unique user ID of the ParaPlayer |
flySpeed | Horizontal flight speed |
flyVerticalSpeed | Vertical flight speed |
flyMaxHeight | Maximum flight height |
flyMinHeight | Minimum flight height |
scale | The scale of players' Avatars |
Public Methods
ClearPlayerTags | Clears a specified tag. All tags will be cleared if the parameter is left empty. Anyone can clear tags, with no permission required. |
Crouch | Controls the crouch action of the player. This method is effective only for local players. |
ChangeState | Switches to a state. |
ChangeVoiceChannel | Changes the voice channel of the player. |
Die | Sets a character to die. |
DisableInteraction | Disables interaction based on InteractiveButtonType and HandType. |
Drop | Drops the picked-up object. This method is effective only for local players. |
EnableInteraction | Enables interaction based on InteractiveButtonType and HandType. |
GetBonePosition | Returns the position of the bone mapped by the human bone ID. Returns null if the Animator component is disabled, if no description of the Avatar exists, or if the bone ID is invalid. |
GetBoneRotation | Returns the orientation of the bone mapped by the human bone ID. Returns null if the Animator component is disabled, if no description of the Avatar exists, or if the bone ID is invalid. |
GetBoneTransform | Returns the Transform mapped by the human bone ID. Returns null if the Animator component is disabled, if no description of the Avatar exists, or if the bone ID is invalid. |
GetCameraType | Returns the camera type. This method is effective only for local players. |
GetGesture | Returns the player's current gesture status. |
GetHeadImage | Returns the player's photo information. |
GetPickupInHand | Returns the object picked up by a specified hand. |
GetPlayerTag | Returns the value of the tag specified by the player. |
GetSpeed | Returns the movement speed of the player. |
GetState | Returns the character's state. |
GetStateEnabled | Checks whether the character's state is enabled. |
Immobilize | When this method is set to True, the player is unable to move by using the joystick. This method is effective only for local players. You can undo this effect by setting this method to False. This setting does not affect the player's current state and only applies to subsequent input. |
Interact | Used for interaction with other objects by the player. This method is effective only for local players. |
IsDead | Checks whether the player is dead. |
IsOnline | Checks whether the player is online. |
IsSitting | Checks whether the player is sitting. |
IsPlayerGrounded | Checks whether the player is on the ground. |
Jump | Jumps. |
MoveContinuously | Controls the player's movement toward a certain direction. |
Pickup | Picks up the specified object. This method is effective only for local players. |
PlayAnimation | Plays an action. You can use an Animation Event and pass a callback function. |
SetAlpha | Sets the semi-transparency value for the player. When it is set to a value less than 1.0, the player is no longer affected by the transparency change from the camera's zoom-in. when it is set to 1.0, the player returns to normal status. |
SetCameraType | Sets the perspective (the first-person perspective or third-person perspective). This method is only effective for local players. |
SetJumpHeight | Sets the jump height. |
GetJumpHeight | Gets the jump height. |
SetPlayerTag | Adds a tag to the player. Anyone can add a tag, with no permission required. |
SetOverrideAnimationController | Sets the Animator Override Controller. |
SetOverrideAnimation | Sets the animation for overriding. If the value is nil, the original animation will be restored. You can use an Animation Event and pass a callback function. |
SetSpeed | Sets the speed. This method is effective only for local players. |
SetStateEnabled | Enables/Disables the character's state. |
SitDown | Sits down. This method is effective only for local players. |
StandUp | Stands up. This method is effective only for local players. |
StopAnimation | Stops playing actions. |
StopMoving | Stops the player from moving and cancels the effect of MoveContinuously. |
SetParaCameraOffset | Sets the offset of the official camera's focus relative to the viewpoint. This method is effective only for local players. |
Teleport | Teleports the player. This method is effective only for local players. |
TryOnAvatar | Tries on a character. |
GetVoiceVolume | Gets the volume of the microphone that is currently used by the character. |
SetIKEnable | Sets whether to enable IK Layer for a player. This may affect hand-waving, head movement along with the camera, and other effects. |
ShowNameplate | Shows or hides the nameplate of a character. |
SetAvatarCollider | Sets the dimensions of a character to modify the volume of the character's capsule collider. |
GetNameplate | Gets the nameplate. |
EnableAvatarFade | Sets whether to enable the semi-transparency effect for overlapping Avatars. |
SetGravityScale | Sets the ratio of the player's gravity to the global gravity. |
GetGravityScale | Gets the ratio of the player's gravity to the global gravity. |
SetVelocity | Sets the instantaneous velocity of the player. |
GetVelocity | Gets the instantaneous velocity of the player. |
SetCrouchSpeed | Sets the crouch speed. |
GetCrouchSpeed | Gets the crouch speed. |
StartFly | Starts flying |
NetSpawn | Creates a network object bound with the character. |
Messages
OnStateChanged | Callback triggered when the state of the character is changed. The first AvatarStateType parameter indicates the old state and the second AvatarStateType parameter indicates the new state. |
OnStateEnabledChanged | Callback triggered when the enabled state is changed |
OnDied | Callback triggered when the character dies |
OnAvatarLoaded | Callback triggered for responding when the player's Avatar resources are fully loaded |