I am trying to add click event to a-image tag but I not able to do so. Can anyone help me please?
I am trying to add click event to a-image tag but I not able to do so. Can anyone help me please?
try add
<script>
AFRAME.registerComponent('clickhandler', {
init: function() {
this.el.addEventListener('click', () => {
alert('Clicked!')
});
}});
</script>
and add clickhandler attributes to your a-image, like
<a-image clickhandler ... >