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/14f6402b46195258811a545e0247c195 to your computer and use it in GitHub Desktop.
Save flushpot1125/14f6402b46195258811a545e0247c195 to your computer and use it in GitHub Desktop.
//secondary trigger button
var leftLastSecondaryTriggerValue,rightLastSecondaryTriggerValue;
webVRController.onSecondaryTriggerStateChangedObservable.add((stateObject)=>{
if(webVRController.hand ==='left'){
if(leftLastSecondaryTriggerValue < 0.9 && stateObject.value >= 0.9){
}
leftLastSecondaryTriggerValue = stateObject.value;
}else{
if(rightLastSecondaryTriggerValue < 0.9 && stateObject.value >= 0.9){
}
rightLastSecondaryTriggerValue = stateObject.value;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment