Provides the ability to control a GameObject's position based the press of a controller button linked to a specific axis direction.
This script forms the stub of emitting the axis X and Y changes that are then digested by the corresponding Object Control Actions that are listening for the relevant event.
VRTK_ControllerEvents- The Controller Events script to listen for button presses events on.
VRTK_BodyPhysics- The Body Physics script to utilise to determine if falling is occuring.
- Place the
VRTK_ButtonControlscript on either:
- The GameObject with the Controller Events script.
- Any other scene GameObject and provide a valid
VRTK_ControllerEventscomponent to the
Controllerparameter of this script.
- Place a corresponding Object Control Action for the Button Control script to notify of axis changes. Without a corresponding Object Control Action, the Button Control script will do nothing.
- Forward Button: The button to set the y axis to +1.
- Backward Button: The button to set the y axis to -1.
- Left Button: The button to set the x axis to -1.
- Right Button: The button to set the x axis to +1.
Updated less than a minute ago