Creating custom input actions
As a reminder, input actions are specific user inputs or gestures that are mapped to a particular action or behavior in the VR experience. Custom input actions are an essential tool for VR development, providing better control, interactivity, and flexibility in creating immersive VR experiences.
We will create custom input actions that allow us to use all the buttons on our VR hand controllers. Once we have these, we can use code to trigger events using specific button presses.
To create a custom input action (Figure 8.3), go through the following steps:
- Go to the
XR Interaction Manager
GO in our Hierarchy. - In Inspector, double-click on the
XRI Default Input
Actions
asset. - The Input Actions menu will open.
- Click the + button in the Action Maps section to create a new action map.
- Name it
Custom Inputs
. - Select Save Asset.
With our Custom Inputs
action map created, we can create custom actions we can pair to buttons...