Guides
Guides
These docs are for v3.1.0. Click to read the latest docs for v3.3.0.

VRTK_RotatorTrackGrabAttach

extends VRTK_TrackObjectGrabAttach

Overview

The Rotator Track Grab Attach script is used to track the object but instead of the object tracking the direction of the controller, a force is applied to the object to cause it to rotate.

This is ideal for hinged joints on items such as wheels or doors.

Class Methods

StopGrab/1

public override void StopGrab(bool applyGrabbingObjectVelocity)

  • Parameters
  • bool applyGrabbingObjectVelocity - If true will apply the current velocity of the grabbing object to the grabbed object on release.
  • Returns
  • none

The StopGrab method ends the grab of the current object and cleans up the state.

ProcessFixedUpdate/0

public override void ProcessFixedUpdate()

  • Parameters
  • none
  • Returns
  • none

The ProcessFixedUpdate method is run in every FixedUpdate method on the interactable object. It applies a force to the grabbed object to move it in the direction of the grabbing object.

Example

VRTK/Examples/021_Controller_GrabbingObjectsWithJoints demonstrates this grab attach mechanic on the Wheel and Door objects in the scene.