Closed peterlunglum closed 5 years ago
idk if this is what you want, but try this:
var played: false; AFRAME.registerComponent('soundhandler', { tick: function () { var entity = document.querySelector('[sound]'); if (document.querySelector('a-marker').object3D.visible == true) { if (played==false){ entity.components.sound.playSound(); played=true; } } else { }
}
});
I'm getting the following alert in my console when I have a marker detecting a marker and playing audio.
'components:sound:warn All the sounds are playing. If you need to play more sounds simultaneously consider increasing the size of pool with the
poolSize
attribute. <a-entity sound="src: #sound" autoplay="false">'I have the following script to attach the sound:
Here's the code for my scene:
It seems to register or detect the marker for every frame. Any ideas on what would cause this notification to popup constantly while the marker is in view?