Two OnActorBeginOverlap Triggers only one working

So I have set up two different box triggers that play sounds when character enters box , one sound plays fine and I the next box trigger which is on a different part of map is not working. I have set bot up same way. Unsure what to do now, I have spent whole day fixing something that should be very simple.

Hello,

If you hook up the sound that you are using for the non-working trigger box to the working trigger box (meaning take the scary breath sound and set that to play when the first trigger is overlapped) does it play the sound?

It could just be that the particular sound you are using is not being heard.

Also, keep an eye on the debug flow of the blueprint to see if the overlap event for that trigger is ever being called.

Yes each sound will work on its own but it seems that if I have more then one trigger in the level only one works. I know this does not make sense. I tested the other sound to make sure the file was okay by also placing it as an ambient sound with no trigger and I can hear it. Only thing i can think of is by the time I get to the second trigger it has already fired. Even though I have unchecked the auto play. Ill fool around with it more because this should not be that hard.

After your overlap event, drag off the Other Actor pin and cast it to your character before playing the sound just to ensure that it isn’t being overlapped by anything other than your character.

Tried this and still nothing. I know its something simple too. I just cant see it.

What happens if you temporarily delete “OnActorBeginOverlap (TriggerBox2)” from the graph, does the sound play for “OnActorBeginOverlap (TriggerBox)”?

What happens if you temporarily delete “OnActorBeginOverlap (TriggerBox)” from the graph, does the sound play for “OnActorBeginOverlap (TriggerBox2)”?

Okay now we are getting somewhere. OABO(TriggerBox 2) works no matter what but OABO(triggerbox) only works if OABO(2) is deleted.

I suspect OnBeginActorOverlap event is only allowed to be added once to an Actor blueprint – only one is executed at all times.

This limitation is exists for some events, but not all. For example you can have multiple “On Left Mouse Click” events wired up and on left click all those events are triggered.

Some blueprints can only have one instance of a given event and if they have more than one instance of that specific event, only the first instance is triggered.

For example.

  1. Create an Actor that inherits from Actor, let’s call it MyBaseActor.
  2. Create another Actor that inherits from MyBaseActor, call this one MyChildActor.
  3. Wire up a BeginPlay execution event to print strings for both MyBaseActor and MyChildActor.
  4. Instantiate those in the game and notice how the parent event BeginPlay is never executed, only the child actor.

I suspect this same limitation is what you’re running into.

Is this a bad thing? Not necessarily, looking at your blueprint code I noticed that a lot of your nodes are copy-pasted with no changes. This indicates to me that you’re design approach can be better.

Try to find another approach (most likely through the use of casting) to ensure you only need one OnActorBeginOverlap event node in the graph. If you would like help with a design solution I’d need to see a little bit more of your surrounding code.

Okay so should I be able to change one overlap to end and keep other begin should this fix the problem? From what your saying that should be a work around also if I am correct. But I have tried that and still the same problem . Also what other could do you need to see I appreciate any advice/help.

I also tried this , should this work also. I check to see if the triggerbox is overlapping another character cast that to my character. The way I set up it does not work, but maybe it should.

I’ve tested this just now in a clean project with a more simplified setup.

I added 2 Box Triggers to the level (to be specific, I added one and then alt+dragged it to duplicate it). I added Begin Overlap events for both triggers in the Level Blueprint, then casted each one to FirstPersonCharacter (I’m using FP template) and printed a string.

Each trigger was called individually and seemed to be working as expected.

Is it possible that you accidentally unchecked Generate Overlap Events in one of the trigger’s settings when trying to debug something? I’d check to make sure that option is still enabled.

Also, try the same setup, but simplify it to see if a print string will work instead of playing the sound.

Finally, when you casted, you’ll need to cast off of each overlap event, not just one of them. That might help as well.

You’re right, this is probably an issue with collision settings on the box trigger.

Okay I did try the print string and both print so now I will delete each sound and re-import to see .

So found the problem it is the destroy actor , but I am not sure why. When I disconnect destroy actor everything works fine. I wanted to prevent the sound from looping (and yes I have the loop unchecked on the sound) But it still plays the sound when my character goes back through the trigger. So I set it to EndOverLap which works kind of like I want. I still would like to know how I set the destroy actor wrong though.

It doesn’t look like you’re actually destroying the audio cue. You should likely hook up a reference to the audio cue to the destroy actor node to ensure that that is the actor it’s looking to destroy. Without having access to the project it’s difficult to tell what the Self reference would be in that case.

This is what you meant correct I have attached the sound to destroy , but this disables both sounds from working.

You’ll need to add the delay first to allow the sound to play before destroying it. I’d recommend destroying the sound On End Overlap if you want it to play for the duration of the time the character is inside of the trigger volume.

I’d recommend starting the blueprint from scratch at this point. Create the simplest setup that you need for your sound to play, meaning just the overlap and then play the sound. After this works, then you can begin to add in the extra features such as disabling the sound from playing more than once, etc.

There it is I knew it was something so simple that I was missing. Great help thanks a lot.

How do I marked this as solved?