Skip to main content
namespace ML.SDK
Class | Sealed

MLPlayer


namespace ML.SDK
{
sealed class MLPlayer
}

Summary

Reference to a Massive Loop player in runtime.

Properties

PropertyDesciption
IsInstantiatedIs the player properly instantiated?
ActorIdUnique ID given to the player in room. Note that this id is only persistent during the session.
AvatarTrackedObjectAvatar tracked object is a game object which is tracked by the VR camera. This means that this object is located where the player camera is.
CurrentAvatarGuidThe Guid of the players current avatar (read-only).
GuidA unique and persistent GUID representing the Massive Loop player. This ID will remain perpetually persistent between different sessions.
HealthPredefined Health property of the player. It is synchronized between all clients in the room. Note that it is not defined by default.
IsGroundedTrue if the players avatar is grounded, i.e., touching ground.
IsLocalIs this player the local player? Local to the script which is retrieving this value. For every client there is only one local player. The player that controlled by the user. Other players in the room are called remote players and those are controlled by other users who joined the room.
IsMasterClientIs this player a MasterClient? Check out this article to know more about concept of master client.
LocomotionPlayer’s locomotion controls. You can modify the locomotion values and types using this class. Only on local player.
NetworkIDUnique Network ID given to the player. It is not a persistent ID and subject to change during the session.
UserInputLocal user inputs. Allows access to local player's control inputs.
NickNameA non-unique name of the player.
PlayerRootThe Root GameObject of the player.
ScorePredefined Score property of the Player. It is synchronized between all clients in the room. Note that it is not defined by default.

Methods

MethodDescription
LoadPlayerThumbnail(Action<Texture2D>)Loads the player Thumbnail.
GetGravity()Gets the player’s current gravity value.
GetProperty(string)Returns the value of the custom property. Returns null in case if the property does not exist or the value is invalid. Use ML.SDK.MLPlayer.PropertyExists function to check if the property is defined. It might take some time before for newly defined property to propagate between all clients.
PropertyExists(string)Checks if a custom property is defined. This does not guarantee that the value of the property is valid.
Portal(string, string, PortalBehavior, string)Send player to another world. This method only take effect if player is the local player. Note that this method also will not work in Local/Editor Mode.
Rotate(float)Rotates player root by given degree.
SetAvatar(string)Set the avatar for the current avatar. Note that this function only works for local player, and it always shows a prompt for user to allow changing avatar. You can use ML.SDK.MLPlayer.CurrentAvatarGuid property to check if player have the avatar you desire.
SetGravity(float, bool)Sets the players gravity value. This value changes the gravitational forces applied to the player. Use SetGravityAxis To set the gravitational directions. The value must be between [-50,50]. Default value is -10.
SetGravityAxis(Vector3, bool)Set the gravity axis of the player.
SetHeading(float)Sets the player heading. Heading is defined by Z+ axis being the 0 degree and increasing in clockwise.
SetProperty(string, Object)Sets a custom property to the player. Custom properties are synchronized between the clients. Make sure the property type is serializable.
Teleport(Vector3)Teleports the player root to the desired location in the scene.
TryClearReceiverChannels()Clears the player receiver channels.
TryClearTransmissionChannels()Clears the player transmission channels.
TryGetReceiverChannels(byte[])Gets the player receiver channels.
TryGetTransmissionChannels(byte[])Gets the transmission channels.
UpdateReceiverChannels(byte[], byte[])Update receiving channel of the local client.
UpdateTransmissionChannels(byte[], byte[])Update transmission channel of the local client.
TryUpdateChannel0PolicyVolume(float)Update the volume of the Channel0 policy
SetAnimationBoolValue(string, bool)Sets a boolean parameter's value in player's animator, if the parameter exists. This function can set player's Locomotion, Hand and Emote parameters. Only for local player
GetAnimationBoolValue(string)Gets a boolean animation value from player's animator, if the parameter exists. This function can get player's Locomotion, Hand and Emote parameters.
SetAnimationIntValue(string, int)Sets an integer parameter's value in player's animator, if the parameter exists. This function can set player's Locomotion, Hand and Emote parameters. Only for local player
GetAnimationIntValue(string)Gets an integer animation value from player's animator, if the parameter exists. This function can get player's Locomotion, Hand and Emote parameters.
SetAnimationFloatValue(string, float)Sets an float parameter's value in player's animator, if the parameter exists. This function can set player's Locomotion, Hand and Emote parameters. Only for local player
GetAnimationFloatValue(string)Gets a float animation value from player's animator, if the parameter exists. This function can get player's Locomotion, Hand and Emote parameters.
SetAnimatorTrigger(string)Trigger a parameter in player's animation, if the parameter exists. This function can set player's Locomotion, Hand and Emote parameters. Only for local player
ResetAnimatorTrigger(string)Resets the trigger parameter in player's animator, if the parameter exists. This function can set player's Locomotion, Hand and Emote parameters. Only for local player
HasAnimationParameter(string)Checks if some of the animators in the player (Locomotion, Hand and Emote) contains the parameter.
BindToPortalHaltStatus(Action<bool>)Calls the function when halt status is assigned Only for local player
UnbindToPortalHaltStatus(Action<bool>)Action that need to removed from halt status callback Only for local player
IsPortalingHalted()Returns portal halt status Only for local player