It must be something I am overlooking, but I can’t for the life of me get the isPlaying('slotname') method of PlayCanvas’ SoundComponent to work. See documentation
I have an entity with a SoundComponent with a slot named ‘Slot1’ and the following code snippet:
this.entity.sound.play('Slot1'); //Works fine
this.entity.sound.isPlaying('Slot1'); //For some reason throws error
hm… weird now I’m getting “this.entity.sound.slot is not a function”…
I’m guessing it might be something weird with our project setup?
I’ll try with a fresh project
I double checked in the new blank project and the “this.entity.sound.slot(‘Slot1’).isPlaying” call worked there, so I guess there was something with our larger project that was interfering or something.