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
Field | Desciption |
---|---|
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. |
OnPrimaryGrabBegin | Event fired when a player grabs the object by primary hand. This event will be synchronized if MLSynchronizer is used. |
OnPrimaryGrabEnd | Event fired when the player releases the object from the primary hand. This event will be synchronized if MLSynchronizer is used. |
OnSecondaryGrabBegin | Event fired when the player grabs the object by their secondary hand. This event will be synchronized if MLSynchronizer is used. |
OnSecondaryGrabEnd | Event fired when the player released the object from secondary hand. This event will be synchronized if MLSynchronizer is used. |
OnPrimaryTriggerDown | Event 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. |
OnPrimaryTriggerUp | Event 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. |
OnSecondaryTriggerDown | Event 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. |
OnSecondaryTriggerUp | Event 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] |
enableOutline | When enabled, outline will be added on the object |
Properties
Property | Desciption |
---|---|
CurrentUser | Current player who is grabbing the object. Null if no one is holding to the object. |
ExpectedObjectPosition | The calculated, expected position of the grabbed object based on the players hands and grab points using the default grab mechanics. |
ExpectedObjectRotation | The calculated, expected rotation of the grabbed object based on the players hands and grab points using the default grab mechanics. |
PrimaryGrabPoint | The transform the of the current Primary grab point. Can be used to create a custom grab mechanics. |
PrimaryHand | The transform the of the current player’s primary hand. Can be used to create a custom grab mechanics. |
SecondaryGrabPoint | The transform the of the current Secondary grab point. Can be used to create a custom grab mechanics. |
SecondaryHand | The transform the of the current player’s secondary hand. Can be used to create a custom grab mechanics. |
Methods
Method | Description |
---|---|
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 |