When I play click on the a-entity it plays the sound, but how can I get it to stop all other sounds when played, so it is not a loud muddled mess of a thing?
I've googled the problem and tried adding the codes they use, but they haven't been working, I've tried about 5 different ones.
I am running my sound like this:
<audio id="mercury-sound" src="mercury.mp3" preload="auto"></audio>
<script id="mercury" type="text/html">
<a-entity class="mercury"
geometry="primitive: sphere; radius: 0.67"
material="shader: flat; src: ${thumb}"
event-set__mouseenter="_target: #image-mercury; material.src: ${src}; opacity: 1"
event-set__mouseleave="_target: #image-mercury; material.src: ${src}; opacity: 0">
</a-entity>
</script>
<a-entity template="src: #mercury" sound="src: #mercury-sound; on"></a-entity>
I want it to play the sound and stop all other sounds when played.
EDIT: if anyone else is having this issue, this is what fixed it
The template component is creating child nodes, You need to grab let el = e.target.parentNode. Check it out here also i would manage all sound-related logic in js, but thats another topic :) btw where is poor pluto ! – Piotr Adam Milewski