Custom Virtual Reality UX
Use `XrService` to interact with virtual reality devices and controllers
Custom Locomotion Settings
import { Script, Asset } from "playcanvas";
import { XrService, XrTypes } from "../@viverse/create-sdk.mjs";
export class ViverseXrManager extends Script {
static scriptName = "viverseXrManager";
initialize() {
this.xrService = new XrService();
this.xrService.controllers.right.locomotionType = XrTypes.LocomotionTypes.Teleport;
this.xrService.controllers.left.locomotionType = XrTypes.LocomotionTypes.Smooth; // Smooth
// See enum definitions here:
// https://viveportsoftware.github.io/pc-lib/enums/XrTypes.LocomotionTypes.html
}
}Custom Controller Models

Last updated
Was this helpful?