PlayerControl
Class
OasisMainPlayer
When the world is created, the leading color is created by default.
The protagonist color controlled by the player can change the character's behavior by modifying the motion parameters and input control. Its spatial data and motion attributes will be synchronized to the network in real time and displayed to other players.
You can play the default or customized emoticons in the SDK.
Character actions are based on the Unity mecanim animation system and FinalIk performance.
Properties
string UUID [readonly]
Player ID in game.
Vector3 forward [readonly]
Forward of the player.
enum_PlayerState playerState [readonly]
Player animation state.
Vector3 velocity [readonly]
Get the current physical motion velocity vector of the player.
Vector3 angularVelocity [readonly]
Get the current physical motion angular velocity vector of the player.
Functions
MoveTo(vec3, bool)
The character moves to the target position at the current speed, and you can choose whether to turn.
Move(vec2)
Move the character in the specified direction, and you can choose whether to turn.
ResetPosition(vec3)
Modify the character location.
Turn(float)
Turn the character at the existing angular speed.
SetAngle(float)
Change the character orientation.
LookAt(vec3, bool)
Make the head look at the target position, and you can choose whether to turn (beyond the rotation range of the head, the body will turn towards).
Jump()
One jump at the existing jump speed.
JumpTo(vec3)
Jump to the target position and automatically adjust the horizontal and vertical speed according to the distance.
Seat(seatobj)
Specify vehicle to put character into riding state.
getSize()
Get the size of the character, which refers to the height of the model.
setSize(float)
Modify the character size, which means to modify the model height.
setMoveSpeed(enum_pose, enum_dir, float)
Set the player's movement speed.
enum_dir,
4 direction values will be set.getMoveSpeed(enum_pose, enum_dir)
Get the movement speed of the player in the specified direction.
setTurnSpeed(float)
Set the speed value of the current steering. (must be > = 0)
setJumpSpeed(float)
Set the current jump speed value. (must be > = 0)
setGravity(float)
Set the current gravity factor.(must be > = 0)
getGravity()
Get the current value of gravity coefficient.
getAnimatorState()
Get the current animator's animation name.
Events
OnEnterWorld()
Called when the character enters the map.
OnLeaveWorld()
Called when the character leaves the map.
OnStateChange(enum_state)
Called when the role state changes.
OnTriggerOther(player)
Called when the character is close to other players.
OnAnimatorEnterState(state)
Called when the character unity animator enters a new state.
OnAnimatorExitState(state)
Called when the character animator leaves the state.
OnMoveToFinish()
Called when the MoveTo() function finishes executing.
OnTurnFinish()
Called when the Turn() function finishes executing.
OnBeginChangeAvatar()
Called when a model change starts.
OnFinishChangeAvatar()
Called when the replacement model is complete.
Last updated
Was this helpful?