Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//Trigger button
var leftLastTriggerValue,rightLastTriggerValue;
webVRController.onTriggerStateChangedObservable.add((stateObject)=>{
if(webVRController.hand ==='left'){
if(leftLastTriggerValue < 0.9 && stateObject.value >= 0.9){
console.log("Left main Trigger button pressed");
}
leftLastTriggerValue = stateObject.value;
}else{
if(rightLastTriggerValue < 0.9 && stateObject.value >= 0.9){
console.log("Right main Trigger button pressed");
}
rightLastTriggerValue = stateObject.value;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment