Skip to main content

MLGrab

info

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

NameDescription
MLGrab.CurrentUserCurrent player who is grabbing the object. Nil if no one is holding to the object.
MLGrab.ExpectedObjectPositionThe calculated, expected position of the grabbed object based on the players hands and grab points using the default grab mechanics.
MLGrab.ExpectedObjectRotationThe calculated, expected rotation of the grabbed object based on the players hands and grab points using the default grab mechanics.
MLGrab.OnPrimaryGrabBeginThe 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.OnPrimaryGrabEndThe 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.OnPrimaryTriggerDownThe 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.OnPrimaryTriggerDownLocalSimilar 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.OnPrimaryTriggerUpThe 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.OnPrimaryTriggerUpLocalSimilar 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.OnSecondaryGrabBeginThe 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.OnSecondaryGrabEndThe 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.OnSecondaryTriggerDownThe 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.OnSecondaryTriggerDownLocalSimilar 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.OnSecondaryTriggerUpThe 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.OnSecondaryTriggerUpLocalSimilar 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.PrimaryGrabPointThe transform the of the current Primary grab point. Can be used to create a custom grab mechanics.
MLGrab.PrimaryHandThe transform the of the current player’s primary hand. Can be used to create a custom grab mechanics.
MLGrab.SecondaryGrabPointThe transform the of the current Secondary grab point. Can be used to create a custom grab mechanics.
MLGrab.SecondaryHandThe transform the of the current player’s secondary hand. Can be used to create a custom grab mechanics.

Methods

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

Inherited Members

Inherited Properties

NameDescription
MLGrab.gameObjectThe game object this component is attached to. A component is always attached to a game object.
MLGrab.tagThe tag of this game object.
MLGrab.transformThe Transform attached to this GameObject.
MLGrab.hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
MLGrab.nameThe name of the object.

Inherited Methods

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