AR.js icon indicating copy to clipboard operation
AR.js copied to clipboard

Click events does not work with a-frame 1.x.x

Open nicolocarpignoli opened this issue 5 years ago • 5 comments

Do you want to request a feature or report a bug? A bug

What is the current behavior?

Click events using cursor component of A-Frame are not working with A-Frame version 1.xx

If the current behavior is a bug, please provide the steps to reproduce.

More details can be found here: https://stackoverflow.com/questions/60562362/touch-on-ar-object-in-ar-js

Please mention other relevant information such as the browser version, Operating System and Device Name

A-Frame version 1.0.4. Worked with 0.9.2 AR.js version is not relevant, also for browser/device.

What is the expected behavior?

Click events should work as it worked with a-frame 0.9.2 and below.

nicolocarpignoli avatar Mar 25 '20 17:03 nicolocarpignoli

Are there any updates on this issue?

dzoech avatar Oct 01 '20 09:10 dzoech

Has this been fixed yet?

JakobDoe avatar Apr 19 '21 18:04 JakobDoe

Hey, there! How you're all going? Any news on this one? I tried with 0.9.2, but with no success. If someone managed it to work, can share the source code?

Markkop avatar Aug 13 '21 20:08 Markkop

Hi, does this work for you?

https://hikar.org/webapp/ex1.html

That definitely handles click events for me, and is using A-Frame 1.0.4.

Note how you have to add the raycaster property to your <a-scene>, which specifies the bounds of the world distances at which click events are detected. Without that, it will not work; I think some of the older examples do not feature this,

nickw1 avatar Aug 14 '21 13:08 nickw1

Hey, @nickw1. Thanks for answering! By checking your demo, the expected behavior indeed works fine for me, but it's not using an AR.js marker.

I've made a few tests and I was able to reproduce the bug in this issue using marker-based tracking I've also noticed a related problem when using embedded component.

Here's a demo using 0.9.2 and 1.2.0 versions with and without embedded. https://glitch.com/edit/#!/web-ar-aframe-test

Here's a recording just in case: https://cdn.glitch.com/4c390feb-a40b-4698-8007-38dfc61055d4%2FScreen%20Recording%202021-08-16%20at%2014.44.51-1.mov?v=1629136146070

It seems to be a problem with AR.js, since it works without using a marker. Do you have any ideas on what else we can investigate, @nicolocarpignoli?

Markkop avatar Aug 16 '21 17:08 Markkop