I have a code that plays a sound every time the player presses space. However, the sound stop and plays a new again if you press the space button twice. I want the sound to be able to overlay each other if the space button is pressed twice. This is my code: void Update () { if (Input.GetKeyDown(KeyCode.Space)) MusicSource.Play(); } Thanks!
This thread confuses me. It's a question about audio that was posted in the 2D forum and given the tag "graphics". But anyway, use the IsPlaying AudioSource function. Check if the audio is not playing before calling MusicSource.Play();
If I understand you correct you want to start the sfx playback on space and continue any previously started sfx until finished. In this case you need a new Audiosource for each sfx. Likely best to use a pool