VR Add-On
The VR Add-On supplies the abilities, movement types, view types, and item interactions needed to drive an Ultimate Character Controller character with a headset and one or two tracked controllers.
Start here
- Follow Getting Started to enable VR, configure input, and run the demo.
- Use the Setup workflow to configure the project, scene, character, and items.
- Choose a view type, then add the required locomotion abilities and item abilities.
- Read Component Structure when extending or debugging how the VR layer connects to the character controller.
Included abilities and interaction features
| Feature | Use it for |
|---|---|
| Arm Swing | Continuous locomotion driven by tracked arm motion. |
| Move In Place | Continuous locomotion inferred from headset and hand movement. |
| Free Movement | Head-directed, gravity-free movement. |
| Grab And Move | Pulling or throwing the character by grabbing the environment. |
| Directional Rotate | Fixed yaw or pitch turns from directional input. |
| Rotate With Head | Aligning character rotation with headset facing. |
| Finger Indicator | Sending tracked finger input to Animator parameters. |
| Trajectory Move | Drawing and validating a destination arc shared by Dash and Teleport. |
| Dash | Moving toward an accepted trajectory destination at a configured speed. |
| Teleport | Moving to an accepted trajectory destination immediately. |
| Slot Equip | Equipping directly into the tracked hand’s item slot. |
| Hold | Keeping an item in hand and optionally starting a follow-up ability. |
| Flick Reload | Starting Reload after a configured hand-flick gesture. |
Start with one translation ability and one rotation ability. Add hand animation and item abilities only after the headset, controllers, collision, and chosen comfort behavior are stable.
Runtime control
VR locomotion abilities use the standard UltimateCharacterLocomotion API: retrieve a configured instance with GetAbility<T>() and request it through TryStartAbility or TryStopAbility. VR item abilities use the same character component and can be located with GetItemAbility<T>() when a script must inspect or control the configured item interaction.
An API call does not create tracked inputs, a valid trajectory destination, hand-slot data, or the required view type. Complete Setup, then verify each ability’s input and scene prerequisites before making it manual.
See Ultimate Character Controller Abilities for the scripting lifecycle and VR Component Structure for the ownership boundary between tracked hands, movement types, view types, and items.
For a game that chooses locomotion mode at runtime, stop the currently active translation ability before enabling or requesting another. Do not let continuous locomotion and a trajectory move compete for the character’s position in the same frame.
The original add-on release supported both one- and two-controller configurations and was tested with:
- Oculus Rift
- HTC Vive
- Oculus Go
Other devices may work with updated button mappings. The add-on supports first- and third-person perspectives and uses Unity’s XR APIs rather than a device-specific SDK.
Limitations
The VR Add-On currently does not support the following:
- Physical interactions. This includes:
- Physically pulling back a bow
- Removing a clip with your free hand
- Opening a door by twisting a door handle
- First person full body awareness
- First/third person perspective switching
- PUN Multiplayer Add-On
Folder structure
The add-on is imported into Opsive/UltimateCharacterController/Add-Ons/VR. Its scripts are under Scripts. The included VR demo also depends on the main Ultimate Character Controller demo assets.