Skip to main content
namespace ML.SDK
Class | Sealed

MLGrab


namespace ML.SDK
{
sealed class MLGrab
}

Inherits from MonoBehaviour

Summary

MLGrab Components. Make an object grab-able by The Massive Loop players.

Fields

FieldDesciption
GrabMechanic[Pre-Built effect only] The mechanic of the grabbing.
StickToHand[Pre-Built effect only] Keeps the object grabbed by the hand, even if the grab button is released. Releasing the object requires pressing the grab object again.
AllowSteal[Pre-Built effect only]
ForceMultiplier[Pre-Built effect only] Force Mode only. Amount of force factor to applied to the object.
TourqeMultiplier[Pre-Built effect only] Force Mode only. Amount of torque to applied to the object.
ApplyMovementPhysics[Pre-Built effect only] Keeps track of the linear and angular velocities of the object while it is grabbed by player and applies them to object when released.
OnPrimaryGrabBeginEvent fired when a player grabs the object by primary hand. This event will be synchronized if MLSynchronizer is used.
OnPrimaryGrabEndEvent fired when the player releases the object from the primary hand. This event will be synchronized if MLSynchronizer is used.
OnSecondaryGrabBeginEvent fired when the player grabs the object by their secondary hand. This event will be synchronized if MLSynchronizer is used.
OnSecondaryGrabEndEvent fired when the player released the object from secondary hand. This event will be synchronized if MLSynchronizer is used.
OnPrimaryTriggerDownEvent fired when the player presses down the trigger button while holding to the primary grab point of the object. This event will be synchronized if MLSynchronizer is used.
OnPrimaryTriggerUpEvent fired when the player releases the trigger button while holding to the primary grab point of the object. This event will be synchronized if MLSynchronizer is used.
OnSecondaryTriggerDownEvent fired when the player presses down the trigger button while holding to the secondary grab point of the object. This event will be synchronized if MLSynchronizer is used.
OnSecondaryTriggerUpEvent fired when the player releases the trigger button while holding to the secondary grab point of the object. This event will be synchronized if MLSynchronizer is used.
SurfaceGrab[Pre-Built effect only] By enabling this, the object becomes grabbable at any point on surface of any collider attached to it. If not selected, the grab points need to be defined for both primary and secondary hands.
GrabLocations[Pre-Built effect only]
enableOutlineWhen enabled, outline will be added on the object

Properties

PropertyDesciption
CurrentUserCurrent player who is grabbing the object. Null if no one is holding to the object.
ExpectedObjectPositionThe calculated, expected position of the grabbed object based on the players hands and grab points using the default grab mechanics.
ExpectedObjectRotationThe calculated, expected rotation of the grabbed object based on the players hands and grab points using the default grab mechanics.
PrimaryGrabPointThe transform the of the current Primary grab point. Can be used to create a custom grab mechanics.
PrimaryHandThe transform the of the current player’s primary hand. Can be used to create a custom grab mechanics.
SecondaryGrabPointThe transform the of the current Secondary grab point. Can be used to create a custom grab mechanics.
SecondaryHandThe transform the of the current player’s secondary hand. Can be used to create a custom grab mechanics.

Methods

MethodDescription
DropObject()Force drops the object if it is held by local player.
ForceRelease()Force drops the grabbed object if it is held by local player. Similar to ML.SDK.MLGrab.DropObject
CaptureInput()Captures some of the user input to be used while the object is grabbed by local user.The default actions bind to captured controls disabled until the input released. The Input can be released by calling Release input, or dropping object automatically releases the input. Controls which are captured depends on the client mode and the hand: VR Mode Left Hand: left joystick as Range and left joystick button as click.VR Mode Right Hand: right joystick as Range and right joystick button as click.Desktop Mode Left Hand: WASD as range and L_Shift as click. Desktop Mode Right Hand: Arrows as range and R_Shift as click. See ML.SDK.MLGrab.ReleaseInput
ReleaseInput()Releases the captured input back to normal function. See ML.SDK.MLGrab.CaptureInput