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

Independent Radial Menu Controller

extends RadialMenuController

Overview

This script inherited from RadialMenuController and therefore can be used instead of RadialMenuController to allow the RadialMenu to be anchored to any object, not just a controller. The RadialMenu will show when a controller is near the object and the buttons can be clicked with the Use Alias button. The menu also automatically rotates towards the user.

To convert the default RadialMenu prefab to be independent of the controllers:

  • Make the RadialMenu a child of an object other than a controller.
  • Position and scale the menu by adjusting the transform of the RadialMenu empty.
  • Replace RadialMenuController with VRTK_IndependentRadialMenuController.
  • Ensure the parent object has the VRTK_InteractableObject script.
  • Verify that Is Usable and Hold Button to Use are both checked.
  • Attach VRTK_InteractTouch and VRTK_InteractUse scripts to the controllers.

Inspector Parameters

  • Events Manager: If the RadialMenu is the child of an object with VRTK_InteractableObject attached, this will be automatically obtained. It can also be manually set.
  • Add Menu Collider: Whether or not the script should dynamically add a SphereCollider to surround the menu.
  • Collider Radius Multiplier: This times the size of the RadialMenu is the size of the collider.
  • Hide After Execution: If true, after a button is clicked, the RadialMenu will hide.
  • Offset Multiplier: How far away from the object the menu should be placed, relative to the size of the RadialMenu.
  • Rotate Towards: The object the RadialMenu should face towards. If left empty, it will automatically try to find the Headset Camera.