VR Support

2D/3D Paint supports work with VR. Asset uses Unity XR System and support for any other VR plugins can be easily implemented and require minimal code changes to properly work with VR input devices. To enable VR support, perform the following steps:

Image title

Alternatively, you can uncomment the first line of InputController #define XDPAINT_VR_ENABLE.

  • (Optional) Configure VR input devices in InputController.InitVR() method, current body of the method can be replaced;
  • (Optional) Replace XR input line in InputController to change VR input trigger for painting, as an example:

Next line can be changed for VR device input

if (leftHandedControllers.Count > 0 && leftHandedControllers[0].TryGetFeatureValue(CommonUsages.triggerButton, out var triggerValue) && triggerValue)

Replace it with:

Next line can be changed for VR device input

if (leftHandedControllers.Count > 0 && leftHandedControllers[0].TryGetFeatureValue(CommonUsages.primaryButton, out var triggerValue) && triggerValue)

Set Pen Transform as your pen in the InputController component.
That’s all! Your VR device is ready to paint!