Unity: PlayOneShot stopped when Stop is called

851 views Asked by At

I have a method that plays a clip as a one shot:

public void PlaySingleFull(AudioClip clip) {
    efxSource.PlayOneShot(clip);
}

I also have a method that stops anything playing from the same source:

public void StopEfx() {
    efxSource.Stop();
}

PlayOneShot() is supposed to ignore any calls from Stop() and play anyway but mine does stop when Stop() is called. Does anyone have any idea what's up?

1

There are 1 answers

0
Geordi Rugenbrink On

You don't really let us see any execution code, but I am guessing the problem is that you put StopEfx() after the PlaySingleFull(). This will cancel the new effect/song immediately after it's queued. It's the only thing I can think of right now, but I need more code to be sure...