{"_id":"58b158d71756cf370022f910","__v":0,"parentDoc":null,"version":{"_id":"58796781cd4a9c37007c96ef","__v":4,"project":"571fa55ca0acd42000af9545","createdAt":"2017-01-13T23:49:21.393Z","releaseDate":"2017-01-13T23:49:21.393Z","categories":["58796781cd4a9c37007c96f0","58796781cd4a9c37007c96f1","58796781cd4a9c37007c96f2","58796781cd4a9c37007c96f3","58796781cd4a9c37007c96f4","58796781cd4a9c37007c96f5","58796781cd4a9c37007c96f6","58796781cd4a9c37007c96f7","58796781cd4a9c37007c96f8","58796781cd4a9c37007c96f9","58796781cd4a9c37007c96fa","58796781cd4a9c37007c96fb","58796781cd4a9c37007c96fc","58796781cd4a9c37007c96fd","58796781cd4a9c37007c96fe","58796781cd4a9c37007c96ff","58796781cd4a9c37007c9700","58b157ca1756cf370022f90d","58b1596f5dae732f00adeca2","58b1605a5dae732f00adecb1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Mukota","version_clean":"3.1.0","version":"3.1.0"},"user":"571fa519db52d01700f5cf3d","category":{"_id":"58796781cd4a9c37007c96f3","__v":0,"version":"58796781cd4a9c37007c96ef","project":"571fa55ca0acd42000af9545","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T16:41:26.797Z","from_sync":false,"order":4,"slug":"locomotion","title":"Locomotion"},"project":"571fa55ca0acd42000af9545","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-02-25T10:13:43.270Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"## Overview\n\nAn abstract class to provide a mechanism to control an object based on controller input.\n\nAs this is an abstract class, it cannot be applied directly to a game object and performs no logic.\n\n## Inspector Parameters\n\n * **Controller:** The controller to read the controller events from. If this is blank then it will attempt to get a controller events script from the same GameObject.\n * **Device For Direction:** The direction that will be moved in is the direction of this device.\n * **Disable Other Controls On Active:** If this is checked then whenever the axis on the attached controller is being changed, all other object control scripts of the same type on other controllers will be disabled.\n * **Affect On Falling:** If a `VRTK_BodyPhysics` script is present and this is checked, then the object control will affect the play area whilst it is falling.\n * **Control Override Object:** An optional game object to apply the object control to. If this is blank then the PlayArea will be controlled.\n\n## Class Variables\n\n * `public enum DirectionDevices` - Devices for providing direction.\n  * `Headset` - The headset device.\n  * `LeftController` - The left controller device.\n  * `RightController` - The right controller device.\n  * `ControlledObject` - The controlled object.\n\n## Class Events\n\n * `XAxisChanged` - Emitted when the X Axis Changes.\n * `YAxisChanged` - Emitted when the Y Axis Changes.\n\n## Unity Events\n\nAdding the `VRTK_ObjectControl_UnityEvents` component to `VRTK_ObjectControl` object allows access to `UnityEvents` that will react identically to the Class Events.\n\n * `OnXAxisChanged` - Emits the XAxisChanged class event.\n * `OnYAxisChanged` - Emits the YAxisChanged class event.\n\n## Event Payload\n\n * `GameObject controlledGameObject` - The GameObject that is going to be affected.\n * `Transform directionDevice` - The device that is used for the direction.\n * `Vector3 axisDirection` - The axis that is being affected.\n * `Vector3 axis` - The value of the current touchpad touch point based across the axis direction.\n * `float deadzone` - The value of the deadzone based across the axis direction.\n * `bool currentlyFalling` - Whether the controlled GameObject is currently falling.\n * `bool modifierActive` - Whether the modifier button is pressed.","excerpt":"","slug":"vrtk_objectcontrol","type":"basic","title":"VRTK_ObjectControl"}

VRTK_ObjectControl


## Overview An abstract class to provide a mechanism to control an object based on controller input. As this is an abstract class, it cannot be applied directly to a game object and performs no logic. ## Inspector Parameters * **Controller:** The controller to read the controller events from. If this is blank then it will attempt to get a controller events script from the same GameObject. * **Device For Direction:** The direction that will be moved in is the direction of this device. * **Disable Other Controls On Active:** If this is checked then whenever the axis on the attached controller is being changed, all other object control scripts of the same type on other controllers will be disabled. * **Affect On Falling:** If a `VRTK_BodyPhysics` script is present and this is checked, then the object control will affect the play area whilst it is falling. * **Control Override Object:** An optional game object to apply the object control to. If this is blank then the PlayArea will be controlled. ## Class Variables * `public enum DirectionDevices` - Devices for providing direction. * `Headset` - The headset device. * `LeftController` - The left controller device. * `RightController` - The right controller device. * `ControlledObject` - The controlled object. ## Class Events * `XAxisChanged` - Emitted when the X Axis Changes. * `YAxisChanged` - Emitted when the Y Axis Changes. ## Unity Events Adding the `VRTK_ObjectControl_UnityEvents` component to `VRTK_ObjectControl` object allows access to `UnityEvents` that will react identically to the Class Events. * `OnXAxisChanged` - Emits the XAxisChanged class event. * `OnYAxisChanged` - Emits the YAxisChanged class event. ## Event Payload * `GameObject controlledGameObject` - The GameObject that is going to be affected. * `Transform directionDevice` - The device that is used for the direction. * `Vector3 axisDirection` - The axis that is being affected. * `Vector3 axis` - The value of the current touchpad touch point based across the axis direction. * `float deadzone` - The value of the deadzone based across the axis direction. * `bool currentlyFalling` - Whether the controlled GameObject is currently falling. * `bool modifierActive` - Whether the modifier button is pressed.