Skip to main content

MLPlayer

Represents the Massive Loop Player and its properties.

Members

Properties

NameDescription
MLPlayer.ActorIDUnique ID given to the player in room. Note that this id is only persistent during the session.
MLPlayer.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.
MLPlayer.CurrentAvatarGuidThe Guid of the players current avatar (read-only).
MLPlayer.GuidA unique and persistent GUID representing the the Massive Loop player. This ID will remain perpetually persistent between different sessions.
MLPlayer.HealthPredefined Health property of the player. It is synchronized between all clients in the room. Note that it is not defined by default.
MLPlayer.IsGroundedTrue if the players avatar is grounded, i.e., touching ground.
MLPlayer.isLocalIs this player the local player? Local to the script which is retrieving this value.
MLPlayer.isMasterClientIs this player a MasterClient? Check out this article to know more about concept of master client.
MLPlayer.LocomotionPlayer’s locomotion controls. You can modify the locomotion values and types using this class. Only on local player.
MLPlayer.NetworkIDUnique Network ID given to the player. It is not a persistent ID and subject to change during the session.
MLPlayer.NickNameA non-unique name of the player.
MLPlayer.OnAvatarUpdatedCalled when the player changes their avatar.
MLPlayer.OnTransmissionChannelUpdateCalled when transmission channels get updated on the server.
MLPlayer.PlayerRootThe Root GameObject of the player.
MLPlayer.ScorePredefined Score property of the Player. It is synchronized between all clients in the room. Note that it is not defined by default.
MLPlayer.ThumbnailSpriteUser’s thumbnail image as sprite.
MLPlayer.ThumbnailTextureUser’s thumbnail image as Texture2D

Methods

NameDescription
MLPlayer.GetAnimationBoolValue(name)Gets a boolean animation value from player's animator, if the parameter exists. This function can get player's Locomotion, Hand and Emote parameters.
MLPlayer.GetAnimationFloatValue(name)Gets a float animation value from player's animator, if the parameter exists. This function can get player's Locomotion, Hand and Emote parameters.
MLPlayer.GetAnimationIntValue(name)Gets an integer animation value from player's animator, if the parameter exists. This function can get player's Locomotion, Hand and Emote parameters.
MLPlayer.GetGravity()Gets the player’s current gravity value.
MLPlayer.GetPlayerInput()Gets local user inputs. Allows access to local player's control inputs.
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.HasAnimationParameter(name)Checks if some of the animators in the player (Locomotion, Hand and Emote) contains the parameter.
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.ResetAnimatorTrigger(name)Resets the trigger parameter in player's animator, if the parameter exists. This function can set player's Locomotion, Hand and Emote parameters. Note: Only for local player
MLPlayer.Rotate(rotation)Rotates player root by given degree.
MLPlayer.SetAnimationBoolValue(name, value)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. Note: Only for local player
MLPlayer.SetAnimationFloatValue(name, value)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. Note: Only for local player
MLPlayer.SetAnimationIntValue(name, value)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. Note: Only for local player
MLPlayer.SetAnimatorTrigger(name)Trigger a parameter in player's animation, if the parameter exists. This function can set player's Locomotion, Hand and Emote parameters. Note: Only for local player
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, resetVerticalVelocity=false)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.