Can't delete spawned sound 2D

This blueprint is inside game instance. I want to have separate tracks for Menu level and Gameplay level. When character dies the Gameplay level reloads. Everything works until I open Menu level from the Gameplay level. The Gameplay track still play and can’t delete it because it says it’s pending delete.

I’m confused and don’t know how to fix this

1 Like

You could just make the concurrency 1, and then you don’t need to worry about it :slight_smile:

The pic is a bit to small to see clearly.

Yeah but those are 2 different sound

1 Like

Put a do once on the opening of the Menu, then destroy actor, seems like a sequence would be much more efficent for this.

I would get rid of the ‘replace music’ bool.

Just send it something to play, if there’s something already playing ( valid ref ), then destroy it and make a new one, otherwise just spawn.

If you send it the same music twice, that’s just another problem.

It’s also possible to know what is playing from the reference, you could use that to figure out if you need to replace. ( Can’t recall the exact node, and I’m not at a machine rn, but I have done it ).

Can’t get rid off Replace Music because when a character dies level is reloaded so I need the track to keep playing

When I print it out after going back to the Menu, this is what I get.

image

Every time I restart game it goes up by 1: AudioComponent10,11,12…

This will always replace the sound if need be

image

I get those errors and music starts playing again after every level reload.

It’s very weird. Even here the name of this is NoneAudioComponentX. And X keeps rising every gameplay