VRTK_InteractControllerAppearance
Overview
The Interact Controller Appearance script is attached on the same GameObject as an Interactable Object script and is used to determine whether the controller model should be visible or hidden on touch, grab or use.
Inspector Parameters
- Hide Controller On Touch: Hides the controller model when a valid touch occurs.
- Hide Delay On Touch: The amount of seconds to wait before hiding the controller on touch.
- Hide Controller On Grab: Hides the controller model when a valid grab occurs.
- Hide Delay On Grab: The amount of seconds to wait before hiding the controller on grab.
- Hide Controller On Use: Hides the controller model when a valid use occurs.
- Hide Delay On Use: The amount of seconds to wait before hiding the controller on use.
Class Methods
ToggleControllerOnTouch/3
public virtual void ToggleControllerOnTouch(bool showController, VRTK_ControllerActions controllerActions, GameObject obj)
- Parameters
bool showController
- If true then the controller will attempt to be made visible when no longer touching, if false then the controller will be hidden on touch.VRTK_ControllerActions controllerActions
- The controller to apply the visibility state to.GameObject obj
- The object that is currently being interacted with by the controller which is passed through to the visibility to prevent the object from being hidden as well.- Returns
- none
The ToggleControllerOnTouch method determines whether the controller should be shown or hidden when touching an interactable object.
ToggleControllerOnGrab/3
public virtual void ToggleControllerOnGrab(bool showController, VRTK_ControllerActions controllerActions, GameObject obj)
- Parameters
bool showController
- If true then the controller will attempt to be made visible when no longer grabbing, if false then the controller will be hidden on grab.VRTK_ControllerActions controllerActions
- The controller to apply the visibility state to.GameObject obj
- The object that is currently being interacted with by the controller which is passed through to the visibility to prevent the object from being hidden as well.- Returns
- none
The ToggleControllerOnGrab method determines whether the controller should be shown or hidden when grabbing an interactable object.
ToggleControllerOnUse/3
public virtual void ToggleControllerOnUse(bool showController, VRTK_ControllerActions controllerActions, GameObject obj)
- Parameters
bool showController
- If true then the controller will attempt to be made visible when no longer using, if false then the controller will be hidden on use.VRTK_ControllerActions controllerActions
- The controller to apply the visibility state to.GameObject obj
- The object that is currently being interacted with by the controller which is passed through to the visibility to prevent the object from being hidden as well.- Returns
- none
The ToggleControllerOnUse method determines whether the controller should be shown or hidden when using an interactable object.
Example
VRTK/Examples/008_Controller_UsingAGrabbedObject
shows that the controller can be hidden when touching, grabbing and using an object.
Updated less than a minute ago