gabor aron gabor aron - 1 year ago 120
Javascript Question

How to get click event with javascript from an A-frame element

You can use

onclick= function();
in the HTML.

For example:
<a-box onclick="myFunction()"></a-box>

I want to get click event of cursor with javascript from an A-frame element, like a box for example, how can I do it?

Answer Source

If you are using the cursor component:

box.addEventListener('click', function (evt) { // ... });

If you want to use the mouse cursor, try

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download