{"_id":"594949e62be16d0026ec04fa","category":{"_id":"594949e62be16d0026ec04da","version":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T17:04:07.774Z","from_sync":false,"order":12,"slug":"3d-controls","title":"3D Controls"},"user":"571fa519db52d01700f5cf3d","parentDoc":null,"project":"571fa55ca0acd42000af9545","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-01T17:06:28.702Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"> extends [VRTK_Control](doc:vrtk_control)\n\n## Overview\n\nTransforms a game object into a drawer. The direction can be freely set and also auto-detected with very high reliability.\n\nThe script will instantiate the required Rigidbody, Interactable and Joint components automatically in case they do not exist yet. There are situations when it can be very hard to automatically calculate the correct axis for the joint. If this situation is encountered simply add the configurable joint manually and set the axis. All the rest will still be handled by the script.\n\nIt will expect two distinct game objects: a body and a handle. These should be independent and not children of each other. The distance to which the drawer can be pulled out will automatically set depending on the length of it. If no body is specified the current object is assumed to be the body.\n\nIt is possible to supply a third game object which is the root of the contents inside the drawer. When this is specified the VRTK_InteractableObject components will be automatically deactivated in case the drawer is closed or not yet far enough open. This eliminates the issue that a user could grab an object inside a drawer although it is closed.\n\n## Inspector Parameters\n\n * **Connected To:** An optional game object to which the drawer will be connected. If the game object moves the drawer will follow along.\n * **Direction:** The axis on which the drawer should open. All other axis will be frozen.\n * **Body:** The game object for the body.\n * **Handle:** The game object for the handle.\n * **Content:** The parent game object for the drawer content elements.\n * **Hide Content:** Makes the content invisible while the drawer is closed.\n * **Min Snap Close:** If the extension of the drawer is below this percentage then the drawer will snap shut.\n * **Max Extend:** The maximum percentage of the drawer's total length that the drawer will open to.\n\n## Example\n\n`VRTK/Examples/025_Controls_Overview` shows a drawer with contents that can be opened and closed freely and the contents can be removed from the drawer.","excerpt":"","slug":"vrtk_drawer","type":"basic","title":"VRTK_Drawer"}
> extends [VRTK_Control](doc:vrtk_control) ## Overview Transforms a game object into a drawer. The direction can be freely set and also auto-detected with very high reliability. The script will instantiate the required Rigidbody, Interactable and Joint components automatically in case they do not exist yet. There are situations when it can be very hard to automatically calculate the correct axis for the joint. If this situation is encountered simply add the configurable joint manually and set the axis. All the rest will still be handled by the script. It will expect two distinct game objects: a body and a handle. These should be independent and not children of each other. The distance to which the drawer can be pulled out will automatically set depending on the length of it. If no body is specified the current object is assumed to be the body. It is possible to supply a third game object which is the root of the contents inside the drawer. When this is specified the VRTK_InteractableObject components will be automatically deactivated in case the drawer is closed or not yet far enough open. This eliminates the issue that a user could grab an object inside a drawer although it is closed. ## Inspector Parameters * **Connected To:** An optional game object to which the drawer will be connected. If the game object moves the drawer will follow along. * **Direction:** The axis on which the drawer should open. All other axis will be frozen. * **Body:** The game object for the body. * **Handle:** The game object for the handle. * **Content:** The parent game object for the drawer content elements. * **Hide Content:** Makes the content invisible while the drawer is closed. * **Min Snap Close:** If the extension of the drawer is below this percentage then the drawer will snap shut. * **Max Extend:** The maximum percentage of the drawer's total length that the drawer will open to. ## Example `VRTK/Examples/025_Controls_Overview` shows a drawer with contents that can be opened and closed freely and the contents can be removed from the drawer.