API > MLPlayer
MLPlayer⚓︎
Represents the Massive Loop Player and its properties.
Members⚓︎
Properties⚓︎
Name | Description |
---|---|
MLPlayer .ActorID |
Unique ID given to the player in room. Note that this id is only persistent during the session. |
MLPlayer .AvatarTrackedObject |
Avatar 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. |
MLPlayer .CurrentAvatarGuid |
The Guid of the players current avatar (read-only). |
MLPlayer .Guid |
A unique and persistent GUID representing the the Massive Loop player. This ID will remain perpetually persistent between different sessions. |
MLPlayer .Health |
Predefined Health property of the player. It is synchronized between all clients in the room. Note that it is not defined by default. |
MLPlayer .IsGrounded |
True if the players avatar is grounded, i.e., touching ground. |
MLPlayer .isLocal |
Is this player the local player? Local to the script which is retrieving this value. |
MLPlayer .isMasterClient |
Is this player a MasterClient? Check out this article to know more about concept of master client. |
MLPlayer .Locomotion |
Player’s locomotion controls. You can modify the locomotion values and types using this class. Only on local player. |
MLPlayer .NetworkID |
Unique Network ID given to the player. It is not a persistent ID and subject to change during the session. |
MLPlayer .NickName |
A non-unique name of the player. |
MLPlayer .OnTransmissionChannelUpdate |
Called when transmission channels get updated on the server. |
MLPlayer .PlayerRoot |
The Root GameObject of the player. |
MLPlayer .Score |
Predefined Score property of the Player. It is synchronized between all clients in the room. Note that it is not defined by default. |
MLPlayer .ThumbnailSprite |
User’s thumbnail image as sprite. |
MLPlayer .ThumbnailTexture |
User’s thumbnail image as Texture2D |
Methods⚓︎
Name | Description |
---|---|
MLPlayer .GetGravity() |
Gets the player’s current gravity value. |
MLPlayer .GetProperty(key) |
Returns the value of the custom property. Returns nil in case if the property does not exist or the value is invalid. Use PropertyExists(key) function to check if the property is defined. It might take some time before for newly defined property to propagate between all clients. |
MLPlayer .Portal(worldGuid, region, behavior, insntanceId=nil) |
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 Mode. |
MLPlayer .PropertyExists(key) |
Checks if a custom property is defined. This does not guarantee that the value of the property is valid. |
MLPlayer .Rotate(rotation) |
Rotates player root by given degree. |
MLPlayer .SetAvatar(guid) |
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 CurrentAvatarGuid property to check if player have the avatar you desire. |
MLPlayer .SetGravity(gravityValue) |
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. |
MLPlayer .SetGravityAxis(axis, relativeToPlayer) |
Set the gravity axis of the player. |
MLPlayer .SetHeading(heading) |
Sets the player heading. Heading is defined by Z+ axis being the 0 degree and increasing in clockwise. |
MLPlayer .SetProperty(key, value) |
Sets a custom property to the player. Custom properties are synchronized between the clients. Make sure the property type is serializable. Check out serializable types here |
MLPlayer .Teleport(location) |
Teleports the player root to the desired location. |
MLPlayer .TryClearReceiverChannels() |
Clears the player receiver channels. |
MLPlayer .TryClearTransmissionChannels() |
Clears the player transmission channels. |
MLPlayer .TryGetReceiverChannels() |
Gets the player receiver channels. |
MLPlayer .TryGetTransmissionChannels() |
Gets the transmission channels. |
MLPlayer .UpdateReceiverChannels(channelsToRemove[], channelsToAdd[]) |
Update receiving channel of the local client. |
MLPlayer .UpdateTransmissionChannels(channelsToRemove[], channelsToAdd[]) |
Update transmission channel of the local client. |