- Home /
AudioSource IsPlaying confusion
When ever I needed an audio to play I wrote it like this:
if (!sfx.IsPlaying) { sfx.Play(); }
I also have multiple AS on every objects that I want it to make some sounds.
However, the problems lies when I use the above code it prevent any additional sounds when a sound is already playing. Such as, if a BGM is being played from object A and I want object B to do a scream, the scream will never be played.
Also if I just wrote sfx.Play() without the if statement, I got something that sound like a broken record.
So I got an idea that IsPlaying is not being analysed for a single object, but the entire fleet of AS existed in the game. If so, how do I work around this?
Using Unity 5 BTW.
Your answer
Follow this Question
Related Questions
Play music in Unity without repeating a song 3 Answers
unity 5 for linux no sound 1 Answer
How to change audio output device to bottom speaker on android? 0 Answers
Audio source play stop in Unity5 3 Answers
Is it possible to access the speaker in the DualShock 4 controller without the PS4 kit? 1 Answer