Guides

Controller Rigidbody Activator

Overview

Provides a simple trigger collider volume that when a controller enters will enable the rigidbody on the controller.

Prefab Usage:

  • Place the VRTK/Prefabs/ControllerRigidbodyActivator/ControllerRigidbodyActivator prefab in the scene at the location where the controller rigidbody should be automatically activated.
  • The prefab contains a default sphere collider to determine ths collision, this collider component can be customised in the inspector or can be replaced with another collider component (set to Is Trigger).

If the prefab is placed as a child of the target Interactable Object then the collider volume on the prefab will trigger collisions on the Interactable Object.

Inspector Parameters

  • Is Enabled: If this is checked then the Collider will have it's Rigidbody toggled on and off during a collision.
  • Activate Interact Touch: If this is checked then the Rigidbody Activator will activate the rigidbody and colliders on the Interact Touch script.
  • Activate Tracked Collider: If this is checked then the Rigidbody Activator will activate the rigidbody and colliders on the Controller Tracked Collider script.

Class Events

  • ControllerRigidbodyOn - Emitted when the controller rigidbody is turned on.
  • ControllerRigidbodyOff - Emitted when the controller rigidbody is turned off.

Unity Events

Adding the VRTK_ControllerRigidbodyActivator_UnityEvents component to VRTK_ControllerRigidbodyActivator object allows access to UnityEvents that will react identically to the Class Events.

  • All C# delegate events are mapped to a Unity Event with the On prefix. e.g. MyEvent -> OnMyEvent.

Event Payload

  • interactingObject - The object that touching the activator.