Download

Why does isplaying give an error?

Why does this give an error?

This is the error:


Error Blueprint Runtime Error: Attempted to access AudioComponent_1 via property CallFunc_SpawnSound2D_ReturnValue, but AudioComponent_1 is pending kill from function: 'ExecuteUbergraph_Subtitles' from node: Branch in graph: EventGraph in object: Subtitles with description: Attempted to access AudioComponent_1 via property CallFunc_SpawnSound2D_ReturnValue, but AudioComponent_1 is pending kill

Guessing you’re playing a sound on an actor that eventually gets destroyed. The error is created when the actor is destroyed but the sound is still being called/about to be called by a function. To eliminate the error you can disable the event that plays the sound just before the actor is destroyed–otherwise I would just ignore these errors–they don’t seem to cause any harm.

Screenshot of what you mean by destroying the event that causes them?

So there are a couple ways around this. You can always use an IsValid function before playing the sound, checking to see that the audio component still exists, or you can SetTimerByEvent node to set the event to 0 seconds right before the actor is destroyed. Probably easier to just put the IsValid function in there…

hope that helps and makes sense!

I fixed it by using ‘Bind to Event OnAudioFinished’.

Thanks for the help.