Skip to content

API > MLPlayer


MLPlayer⚓︎

Represents the Massive Loop Player and its properties.

Members⚓︎

Properties⚓︎

Name Description
MLPlayer.ActorIDPropertyReadonly Property Unique ID given to the player in room. Note that this id is only persistent during the session.
MLPlayer.AvatarTrackedObjectPropertyReadonly Property 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.CurrentAvatarGuidPropertyReadonly Property The Guid of the players current avatar (read-only).
MLPlayer.GuidPropertyReadonly Property A unique and persistent GUID representing the the Massive Loop player. This ID will remain perpetually persistent between different sessions.
MLPlayer.HealthProperty Predefined Health property of the player. It is synchronized between all clients in the room. Note that it is not defined by default.
MLPlayer.IsGroundedPropertyReadonly Property True if the players avatar is grounded, i.e., touching ground.
MLPlayer.isLocalPropertyReadonly Property Is this player the local player? Local to the script which is retrieving this value.
MLPlayer.isMasterClientPropertyReadonly Property Is this player a MasterClient? Check out this article to know more about concept of master client.
MLPlayer.LocomotionPropertyReadonly Property Player’s locomotion controls. You can modify the locomotion values and types using this class. Only on local player.
MLPlayer.NetworkIDPropertyReadonly Property Unique Network ID given to the player. It is not a persistent ID and subject to change during the session.
MLPlayer.NickNamePropertyReadonly Property A non-unique name of the player.
MLPlayer.OnTransmissionChannelUpdatePropertyReadonly Property Called when transmission channels get updated on the server.
MLPlayer.PlayerRootPropertyReadonly Property The Root GameObject of the player.
MLPlayer.ScoreProperty Predefined Score property of the Player. It is synchronized between all clients in the room. Note that it is not defined by default.
MLPlayer.ThumbnailSpritePropertyReadonly Property User’s thumbnail image as sprite.
MLPlayer.ThumbnailTexturePropertyReadonly Property User’s thumbnail image as Texture2D

Methods⚓︎

Name Description
MLPlayer.GetGravity() Method Gets the player’s current gravity value.
MLPlayer.GetProperty(key) Method 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) Method 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) Method Checks if a custom property is defined. This does not guarantee that the value of the property is valid.
MLPlayer.Rotate(rotation) Method Rotates player root by given degree.
MLPlayer.SetAvatar(guid) Method 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) Method 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) Method Set the gravity axis of the player.
MLPlayer.SetHeading(heading) Method Sets the player heading. Heading is defined by Z+ axis being the 0 degree and increasing in clockwise.
MLPlayer.SetProperty(key, value) Method 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) Method Teleports the player root to the desired location.
MLPlayer.TryClearReceiverChannels() Method Clears the player receiver channels.
MLPlayer.TryClearTransmissionChannels() Method Clears the player transmission channels.
MLPlayer.TryGetReceiverChannels() Method Gets the player receiver channels.
MLPlayer.TryGetTransmissionChannels() Method Gets the transmission channels.
MLPlayer.UpdateReceiverChannels(channelsToRemove[], channelsToAdd[]) Method Update receiving channel of the local client.
MLPlayer.UpdateTransmissionChannels(channelsToRemove[], channelsToAdd[]) Method Update transmission channel of the local client.