{"_id":"594949e82be16d0026ec053a","category":{"_id":"594949e62be16d0026ec04d4","version":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T16:45:52.489Z","from_sync":false,"order":6,"slug":"interactions","title":"Interactions"},"project":"571fa55ca0acd42000af9545","parentDoc":null,"user":"571fa519db52d01700f5cf3d","version":{"_id":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":2,"createdAt":"2017-06-20T16:14:29.816Z","releaseDate":"2017-06-20T16:14:29.816Z","categories":["594949e62be16d0026ec04ce","594949e62be16d0026ec04cf","594949e62be16d0026ec04d0","594949e62be16d0026ec04d1","594949e62be16d0026ec04d2","594949e62be16d0026ec04d3","594949e62be16d0026ec04d4","594949e62be16d0026ec04d5","594949e62be16d0026ec04d6","594949e62be16d0026ec04d7","594949e62be16d0026ec04d8","594949e62be16d0026ec04d9","594949e62be16d0026ec04da","594949e62be16d0026ec04db","594949e62be16d0026ec04dc","594949e62be16d0026ec04dd","594949e62be16d0026ec04de","594949e62be16d0026ec04df","594949e62be16d0026ec04e0","594949e62be16d0026ec04e1","59497219f4a8980024dd0631"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Kunekune","version_clean":"3.2.0","version":"3.2.0"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-01-01T16:48:13.899Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"## Overview\n\nThe 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.\n\n## Inspector Parameters\n\n * **Hide Controller On Touch:** Hides the controller model when a valid touch occurs.\n * **Hide Delay On Touch:** The amount of seconds to wait before hiding the controller on touch.\n * **Hide Controller On Grab:** Hides the controller model when a valid grab occurs.\n * **Hide Delay On Grab:** The amount of seconds to wait before hiding the controller on grab.\n * **Hide Controller On Use:** Hides the controller model when a valid use occurs.\n * **Hide Delay On Use:** The amount of seconds to wait before hiding the controller on use.\n\n## Class Events\n\n * `ControllerHidden` - Emitted when the interacting object is hidden.\n * `ControllerVisible` - Emitted when the interacting object is shown.\n * `HiddenOnTouch` - Emitted when the interacting object is hidden on touch.\n * `VisibleOnTouch` - Emitted when the interacting object is shown on untouch.\n * `HiddenOnGrab` - Emitted when the interacting object is hidden on grab.\n * `VisibleOnGrab` - Emitted when the interacting object is shown on ungrab.\n * `HiddenOnUse` - Emitted when the interacting object is hidden on use.\n * `VisibleOnUse` - Emitted when the interacting object is shown on unuse.\n\n## Unity Events\n\nAdding the `VRTK_InteractControllerAppearance_UnityEvents` component to `VRTK_InteractControllerAppearance` object allows access to `UnityEvents` that will react identically to the Class Events.\n\n * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.\n\n## Event Payload\n\n * `GameObject interactingObject` - The object that is interacting.\n * `GameObject ignoredObject` - The object that is being ignored.\n\n## Class Methods\n\n### ToggleControllerOnTouch/3\n\n  > `public virtual void ToggleControllerOnTouch(bool showController, GameObject touchingObject, GameObject ignoredObject)`\n\n  * Parameters\n   * `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.\n   * `GameObject touchingObject` - The touching object to apply the visibility state to.\n   * `GameObject ignoredObject` - The object that is currently being interacted with by the touching object which is passed through to the visibility to prevent the object from being hidden as well.\n  * Returns\n   * _none_\n\nThe ToggleControllerOnTouch method determines whether the controller should be shown or hidden when touching an interactable object.\n\n### ToggleControllerOnGrab/3\n\n  > `public virtual void ToggleControllerOnGrab(bool showController, GameObject grabbingObject, GameObject ignoredObject)`\n\n  * Parameters\n   * `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.\n   * `GameObject grabbingObject` - The grabbing object to apply the visibility state to.\n   * `GameObject ignoredObject` - The object that is currently being interacted with by the grabbing object which is passed through to the visibility to prevent the object from being hidden as well.\n  * Returns\n   * _none_\n\nThe ToggleControllerOnGrab method determines whether the controller should be shown or hidden when grabbing an interactable object.\n\n### ToggleControllerOnUse/3\n\n  > `public virtual void ToggleControllerOnUse(bool showController, GameObject usingObject, GameObject ignoredObject)`\n\n  * Parameters\n   * `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.\n   * `GameObject usingObject` - The using object to apply the visibility state to.\n   * `GameObject ignoredObject` - The object that is currently being interacted with by the using object which is passed through to the visibility to prevent the object from being hidden as well.\n  * Returns\n   * _none_\n\nThe ToggleControllerOnUse method determines whether the controller should be shown or hidden when using an interactable object.\n\n## Example\n\n`VRTK/Examples/008_Controller_UsingAGrabbedObject` shows that the controller can be hidden when touching, grabbing and using an object.","excerpt":"","slug":"vrtk_interactcontrollerappearance","type":"basic","title":"VRTK_InteractControllerAppearance"}

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 Events * `ControllerHidden` - Emitted when the interacting object is hidden. * `ControllerVisible` - Emitted when the interacting object is shown. * `HiddenOnTouch` - Emitted when the interacting object is hidden on touch. * `VisibleOnTouch` - Emitted when the interacting object is shown on untouch. * `HiddenOnGrab` - Emitted when the interacting object is hidden on grab. * `VisibleOnGrab` - Emitted when the interacting object is shown on ungrab. * `HiddenOnUse` - Emitted when the interacting object is hidden on use. * `VisibleOnUse` - Emitted when the interacting object is shown on unuse. ## Unity Events Adding the `VRTK_InteractControllerAppearance_UnityEvents` component to `VRTK_InteractControllerAppearance` 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 * `GameObject interactingObject` - The object that is interacting. * `GameObject ignoredObject` - The object that is being ignored. ## Class Methods ### ToggleControllerOnTouch/3 > `public virtual void ToggleControllerOnTouch(bool showController, GameObject touchingObject, GameObject ignoredObject)` * 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. * `GameObject touchingObject` - The touching object to apply the visibility state to. * `GameObject ignoredObject` - The object that is currently being interacted with by the touching object 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, GameObject grabbingObject, GameObject ignoredObject)` * 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. * `GameObject grabbingObject` - The grabbing object to apply the visibility state to. * `GameObject ignoredObject` - The object that is currently being interacted with by the grabbing object 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, GameObject usingObject, GameObject ignoredObject)` * 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. * `GameObject usingObject` - The using object to apply the visibility state to. * `GameObject ignoredObject` - The object that is currently being interacted with by the using object 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.