Skip to content

Instantly share code, notes, and snippets.

@bretmorris
Created May 22, 2020 22:06
Show Gist options
  • Save bretmorris/55448831699333156d2a798950e05428 to your computer and use it in GitHub Desktop.
Save bretmorris/55448831699333156d2a798950e05428 to your computer and use it in GitHub Desktop.
<script>
AFRAME.registerComponent("trigger-listener", {
init: function () {
var el = this.el;
el.addEventListener("triggerdown", function (evt) {
document.getElementById("ball").emit("throw");
});
},
});
</script>
<a-entity
id="primaryHand"
oculus-touch-controls="hand: right"
trigger-listener>
</a-entity>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment