Sound won't stop

Hi,

I have an array of lights that activate when the player overlaps a box collision which is working well. The only issue is that the SFX for the lights remain active when they should stop, images, blueprints and video below, thanks in advance!

  1. Overlap logic

  2. Sound On/Off logic

  3. Error log

Video demonstration (audio buzzing should have stopped)

Pastebin Blueprint

Can you tell how many times this triggers when overlapped?

image

Hi @Everynone , it sounds like twice

That’s not good, right? The overlap would then create 2 sounds but only reference the 2nd one. The 1st sound would become orphaned an inaccessible. You could fiddle with the DoOnce node but it’d be better to address this issue at the core - what are the chances Marcus has something attached to him that also triggers the overlap?

You could print the display name of the component after the cast:

image

You’d then know what is the other bit that messes this up. It should be capsule only. Do tell what you find out.

Sorry I’m not sure how to do the print display name

this is the character

Cast to Marcus, connect Other CompPrint.

This is what I got

image

m_med_nrw_body

Flashlight that I have now updated to no collide

1 Like

So it actually triggers 3 times it seems. You’d need to ensure the Flashlight and the character Mesh cannot interact with the Box - I assume the cylinder is the capsule collider. We’d need to look into the collision settings of those elements.

But perhaps this is enough when set on the Box:

Only the character’s capsule’s type should be set to Pawn:

This way, the Box can only overlap with objects types flagged as Pawn; and only the capsule is of Pawn type.

1 Like

It now works! thank you so much. I’ve attempted to make it fade out before it stops but it still just stops

still get these errors too

Not sure how it’s supposed to work. Perhaps you could elaborate? Sounds auto destroy by default:

Chances are the errors come from the fact that the sound no longer exists (it has played once and self-destruct) yet we attempt to Stop it. Perhaps there is no need to reference or Stop anything. Spawn Sound → Fade. If you want looping sounds, that’s another story…

I’ve attempted to make it fade out before it stops

Stop will not wait for anything, all non-latent nodes execute immediately one after another.


Yet another, albeit somewhat cumbersome, way is to use a validated Get:

Before attempting to access an object that may no longer exist, Stop only if the sound is valid.

1 Like

Validate GET worked a charm, I’m happy to just use that suggestion, thank you very much for your quick replies and solutions as always :slight_smile: :white_check_mark:

1 Like