{"_id":"594949e92be16d0026ec055e","category":{"_id":"594949e62be16d0026ec04d2","version":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T16:41:26.797Z","from_sync":false,"order":4,"slug":"locomotion","title":"Locomotion"},"parentDoc":null,"user":"571fa519db52d01700f5cf3d","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-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 * 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 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. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`. ## 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.