This page has been translated automatically.
Unigine Basics
1. Introduction
2. Managing Virtual Worlds
3. Preparing 3D Models
4. Materials
5. Cameras and Lighting
6. Implementing Application Logic
7. Making Cutscenes and Recording Videos
8. Preparing Your Project for Release
9. Physics
10. Optimization Basics
11. PROJECT2: First-Person Shooter
12. PROJECT3: Third-Person Cross-Country Arcade Racing Game

Changing Controller Grip Button to Trigger

You might want to remap actions or swap the controls in the VR application. As an example, let's do this for the controller. We will remap the Use action from the Grip button to Trigger, and the grab action to the Grip button.

User input for the controller is defined in the VRControllerInput component. It is assigned to the left_preset_0 and right_preset_0 nodes (vr_player -> vr_input) in our VR sample.

To remap actions, do the following:

  1. Select the left_preset_0 node that contains settings for the left controller (the Bind -> Side parameter value is set to LEFT).
  2. Change the Grab Button -> Button value to LEFT_AXIS, and the Use Button -> Button value to LEFT_GRIP:

    VRControllerInput Component

  3. Select the right_preset_0 node that contains settings for the right controller.
  4. Change the Grab Button -> Button value to RIGHT_AXIS, and the Use Button -> Button value to RIGHT_GRIP.
  5. Save changes (Ctrl+S) and press the Play button to run the application.

Now you can grab objects by the trigger, and use them by the Grip side button.

Last update: 2024-11-06
Build: ()