Guides
Guides

VRTK_BaseGrabAction

Overview

Provides a base that all secondary controller grab attach can inherit from.

Script Usage:

This is an abstract class that is to be inherited to a concrete class that provides secondary controller grab action functionality, therefore this script should not be directly used.

Class Methods

Initialise/5

public virtual void Initialise(VRTK_InteractableObject currentGrabbdObject, VRTK_InteractGrab currentPrimaryGrabbingObject, VRTK_InteractGrab currentSecondaryGrabbingObject, Transform primaryGrabPoint, Transform secondaryGrabPoint)

  • Parameters
    • VRTK_InteractableObject currentGrabbdObject - The Interactable Object script for the object currently being grabbed by the primary grabbing object.
    • VRTK_InteractGrab currentPrimaryGrabbingObject - The Interact Grab script for the object that is associated with the primary grabbing object.
    • VRTK_InteractGrab currentSecondaryGrabbingObject - The Interact Grab script for the object that is associated with the secondary grabbing object.
    • Transform primaryGrabPoint - The point on the Interactable Object where the primary Interact Grab initially grabbed the Interactable Object.
    • Transform secondaryGrabPoint - The point on the Interactable Object where the secondary Interact Grab initially grabbed the Interactable Object.
  • Returns
    • none

The Initalise method is used to set up the state of the secondary action when the Interactable Object is initially grabbed by a secondary Interact Grab.

ResetAction/0

public virtual void ResetAction()

  • Parameters
    • none
  • Returns
    • none

The ResetAction method is used to reset the secondary action when the Interactable Object is no longer grabbed by a secondary Interact Grab.

IsActionable/0

public virtual bool IsActionable()

  • Parameters
    • none
  • Returns
    • bool - Returns true if the secondary grab action does perform an action on secondary grab.

The IsActionable method is used to determine if the secondary grab action performs an action on grab.

IsSwappable/0

public virtual bool IsSwappable()

  • Parameters
    • none
  • Returns
    • bool - Returns true if the grab action allows swapping to another grabbing object.

The IsSwappable method is used to determine if the secondary grab action allows to swab the grab state to another grabbing Interactable Object.

ProcessUpdate/0

public virtual void ProcessUpdate()

  • Parameters
    • none
  • Returns
    • none

The ProcessUpdate method runs in every Update on the Interactable Object whilst it is being grabbed by a secondary Interact Grab.

ProcessFixedUpdate/0

public virtual void ProcessFixedUpdate()

  • Parameters
    • none
  • Returns
    • none

The ProcessFixedUpdate method runs in every FixedUpdate on the Interactable Object whilst it is being grabbed by a secondary Interact Grab.

OnDropAction/0

public virtual void OnDropAction()

  • Parameters
    • none
  • Returns
    • none

The OnDropAction method is executed when the current grabbed Interactable Object is dropped and can be used up to clean up any secondary grab actions.