From 0abe363450727ffa4789b747623757107c92cc01 Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Mon, 3 Apr 2023 19:53:32 +0200 Subject: [PATCH] basic principle piggybacking on wristattached component --- index.html | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 436a450..125bb2b 100644 --- a/index.html +++ b/index.html @@ -2984,6 +2984,16 @@ AFRAME.registerComponent('dynamic-unless-picked', { // should unregister on remove }) +AFRAME.registerComponent('collider-check', { + dependencies: ['raycaster'], + + init: function () { + this.el.addEventListener('raycaster-intersection', function (e) { + console.log('Player hit something!',e.detail); + }); + } +}); + // used for testing AFRAME.registerComponent('startfunctions', { init: function () { @@ -3029,7 +3039,9 @@ AFRAME.registerComponent('startfunctions', { - + + + @@ -3049,12 +3061,12 @@ AFRAME.registerComponent('startfunctions', { - - - - - - + + + + + +