Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
xr.input.onControllerAddedObservable.add((controller) => {
controller.onMotionControllerInitObservable.add((motionController) => {
if (motionController.handness === 'left') {
const xr_ids = motionController.getComponentIds();
let triggerComponent = motionController.getComponent(xr_ids[0]);//xr-standard-trigger
triggerComponent.onButtonStateChangedObservable.add(() => {
if (triggerComponent.pressed) {
Box_Left_Trigger.scaling= new BABYLON.Vector3(1.2,1.2,1.2);
}else{
Box_Left_Trigger.scaling= new BABYLON.Vector3(1,1,1);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment