Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/c2d03f858723c2c267ded3a45739200a to your computer and use it in GitHub Desktop.
Save flushpot1125/c2d03f858723c2c267ded3a45739200a to your computer and use it in GitHub Desktop.
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