Skip to content

API > MLGrab


MLGrab⚓︎

MLGrab inherits from Component

API for MLGrab component. You can use this API to create your own grab mechanics or implement extra functionality to grabbing in Massive Loop.

Members⚓︎

Properties⚓︎

Name Description
MLGrab.CurrentUserPropertyReadonly Property Current player who is grabbing the object. Nil if no one is holding to the object.
MLGrab.ExpectedObjectPositionPropertyReadonly Property The calculated, expected position of the grabbed object based on the players hands and grab points using the default grab mechanics.
MLGrab.ExpectedObjectRotationPropertyReadonly Property The calculated, expected rotation of the grabbed object based on the players hands and grab points using the default grab mechanics.
MLGrab.OnPrimaryGrabBeginPropertyReadonly Property The Event handler which gets invoked when the object is grabbed by the primary hand. This event is invoked in all the clients if the grabbable object synchronized through the MLSynchronizer component.
MLGrab.OnPrimaryGrabEndPropertyReadonly Property The Event handler which gets invoked when the object is released by the primary hand. This event is invoked in all the clients if the grabbable object synchronized through the MLSynchronizer component.
MLGrab.OnPrimaryTriggerDownPropertyReadonly Property The Event handler which gets invoked when the triggered button pressed down for the primary hand. This event is invoked in all the clients if the grabbable object synchronized through the MLSynchronizer component.
MLGrab.OnPrimaryTriggerDownLocalPropertyReadonly Property Similar to the OnPrimaryTriggerDown which gets invoked with the trigger button pressed down for the primary hand, however, this event handler only gets invoked if the local player is performing this action.
MLGrab.OnPrimaryTriggerUpPropertyReadonly Property The Event handler which gets invoked when the triggered button released for the primary hand. This event is invoked in all the clients if the grabbable object synchronized through the MLSynchronizer component.
MLGrab.OnPrimaryTriggerUpLocalPropertyReadonly Property Similar to the OnPrimaryTriggeUp which gets invoked with the trigger button released for the primary hand, however, this event handler only gets invoked if the local player is performing this action.
MLGrab.OnSecondaryGrabBeginPropertyReadonly Property The Event handler which gets invoked when the object is grabbed by the secondary hand. This event is invoked in all the clients if the grabbable object synchronized through the MLSynchronizer component.
MLGrab.OnSecondaryGrabEndPropertyReadonly Property The Event handler which gets invoked when the object is released by the secondary hand. This event is invoked in all the clients if the grabbable object synchronized through the MLSynchronizer component.
MLGrab.OnSecondaryTriggerDownPropertyReadonly Property The Event handler which gets invoked when the triggered button pressed down for the secondary hand. This event is invoked in all the clients if the grabbable object synchronized through the MLSynchronizer component.
MLGrab.OnSecondaryTriggerDownLocalPropertyReadonly Property Similar to the OnSecondaryTriggerDown which gets invoked with the trigger button pressed down for the secondary hand, however, this event handler only gets invoked if the local player is performing this action.
MLGrab.OnSecondaryTriggerUpPropertyReadonly Property The Event handler which gets invoked when the triggered button released for the secondary hand. This event is invoked in all the clients if the grabbable object synchronized through the MLSynchronizer component.
MLGrab.OnSecondaryTriggerUpLocalPropertyReadonly Property Similar to the OnSecondaryTriggerUp which gets invoked with the trigger button released for the secondary hand, however, this event handler only gets invoked if the local player is performing this action.
MLGrab.PrimaryGrabPointPropertyReadonly Property The transform the of the current Primary grab point. Can be used to create a custom grab mechanics.
MLGrab.PrimaryHandPropertyReadonly Property The transform the of the current player’s primary hand. Can be used to create a custom grab mechanics.
MLGrab.SecondaryGrabPointPropertyReadonly Property The transform the of the current Secondary grab point. Can be used to create a custom grab mechanics.
MLGrab.SecondaryHandPropertyReadonly Property The transform the of the current player’s secondary hand. Can be used to create a custom grab mechanics.

Methods⚓︎

Name Description
MLGrab.CaptureInput() Method 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.
MLGrab.ForceRelease() Method Force releases the object if it is grabbed.
MLGrab.ReleaseInput() Method Releases the captured input back to normal function.

Inherited Members⚓︎

Inherited Properties⚓︎

Name Description
MLGrab.gameObjectPropertyReadonly Property The game object this component is attached to. A component is always attached to a game object.
MLGrab.tagPropertyReadonly Property The tag of this game object.
MLGrab.transformPropertyReadonly Property The Transform attached to this GameObject.
MLGrab.hideFlagsProperty Should the object be hidden, saved with the Scene or modifiable by the user?
MLGrab.nameProperty The name of the object.

Inherited Methods⚓︎

Name Description
MLGrab.BroadcastMessage(methodName, parameter=nil)Method Calls the method named methodName on every Lua Script in this game object or any of its children.
MLGrab.CompareTag(tag)Method Is this game object tagged with tag ?
MLGrab.GetAllLuaScripts()Method Returns an array of all Lua scripts that attached to the game object.
MLGrab.GetComponent(type)Method Returns the component of Type type if the game object has one attached, nil if it doesn't.
MLGrab.GetComponentInChildren(t)Method Returns the component of Type type in the GameObject or any of its children using depth first search.
MLGrab.GetComponentInParent(t)Method Returns the component of Type type in the GameObject or any of its parents.
MLGrab.GetComponents(type)Method Returns all components of Type type in the GameObject.
MLGrab.GetComponentsInChildren(t)Method Returns all components of Type type in the GameObject or any of its children.
MLGrab.GetComponentsInParent(t)Method Returns all components of Type type in the GameObject or any of its parents.
MLGrab.SendMessage(methodName, value=nil)Method Calls the method named methodName on every Lua Script in this game object.
MLGrab.SendMessageUpwards(methodName, value=nil)Method Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour.
MLGrab.TryGetComponent(type)Method Gets the component of the specified type, if it exists.
MLGrab.GetInstanceID()Method Returns the instance id of the object.