How do I detect a specific overlap event?

Hi Everyone. I would like to know if anyone could help me, I have a box trigger and a ball(Static Mesh) now i just cant figger out blueprint for ONLY if ball and boxtrigger touch each other then something must happen.

So just ball and box must touch not player and other stuff.

Thanx Everyone in Advance !!!

Hey Andrew,

In your ball Blueprint, you can reference a specific actor in your level. Create a new Actor Variable and make it Editable, then Compile. In your level, select Blueprint and go to Details panel. There will be a new section named Default with your new Variable in it. In drop down, select your Trigger Box.

Now in your Blueprint, drag your Variable into Event Graph and select Get. That’s your reference to specific Trigger Box you wanted. rest is simple: create an Event Actor Begin Overlap node, then link that to a Branch node. Drag off Other Actor pin and type == to get a comparison node, to which you can attach your Variable referencing Trigger Box.

What this is doing is checking to see if your ball is overlapping with something, and if it is, whether it is overlapping your Trigger Box. If that’s true, you can then drag off True pin of Branch node. In picture above, I am simply printing “Contact”, but yours can certainly do something more complex.

Hope that helps!

1 Like

Thank you for your time

Any variables that are set to Editable can be edited when Blueprint in which they exist is in level. Place BP in level, and you should see its information in Details window. Any Editable variables can be adjusted there, and they will apply to that instance of BP in level.

In your level, select Blueprint and go to Details panel. There will be a new section named Default with your new Variable in it. In drop down, select your Trigger Box. – Im struggling on how to do this part, it just shows a checkbox @BenHalliday

I added it to level but i dont see drop down to select trigger box.

When you create variable, you need to make sure it’s correct type and that it is Editable:

After you compile Blueprint, variable will appear in its Details:

so how would i now make it so that when ball and trigger touch that a door opens? @BenHalliday

As shown in first image in answer, after branch determines that a collision with specific trigger has occurred, you can place any additional blueprint nodes; replace Print String node with nodes to open your door. There are many possible ways to open a door, but that’s a separate question and I would encourage you to do a search in Blueprint Scripting section for others who have asked same sort of thing. Additionally, it would benefit you to look into documentation on Casting or Blueprint Interfaces.

HEllo,

i just did same graph.
Problem is that i don’t hear any audio(my event) when my object hits referenced trigger box.
I copied exact same graph.
How would i connect an audio event?
I think i am not doing it right.
As for print event. I cant see any strings on my screen either.
My object has also a boom and a camera attached to it.
I have also another float variable in blueprint to clamp camera following movement to certain constraints.
My object is just a static mesh.
Is there any problem with other variable ?

Hi

I’d need more detailed information about your setup and some screenshots to determine why it’s not working for you.

Hi! i followed instructions as given, but i am getting into a trouble / confusion (little bit new.)

i created blueprint, where camera stops moving if character moves into a collider for another blueprint.

But since i am using main character for this, and i have put this in a gameMode, i dont see default option for blueprint.

However, if i drag out my third person controller blueprint, i can see default option on it.

i can choose blueprint on thirdPersonController blueprint, but i cant see option on gameMode for choosing it.
how can i make it possible that i use specific overlapping on my main character?

Have you looked into casting? You can cast to your character and then call functions from your character inside of other blueprints. I’m not sure if this is what you’re looking for though, so could you be a bit more specific about exactly what you are trying to accomplish?

Hi Sean!
i am trying to create a side scroller game where camera stops scrolling if character enters a certain area. i created a blueprint with only collider in it, and i used OnBeginActorOverlap on 3rdPersonCharacter blueprint (got it from example map) that if it touches with collieder, camera detaches from parent and stops moving. i am using example map that is present in unreal, and player start is where player spawns as in picture.

However, i want to add multiple actors that do different things when character overlaps them, so i am using what answer is, but i can only see default tab on 3rdPerson controller blueprint. not on GameStart, as in screenshot. when i press play, i get an error message of accessed none.

accessed none error means that your variable is not actually being populated. Could you show me where in your blueprint you are using back trigger variable through a screenshot please?

My apologies if i am not able to explain this properly. i have only started learning unreal for a month

i created blueprint trigger back, and made a variable inside my character controller and chose blueprint in variable.
i chose “get” by dragging it into screen, and i chose target “box” from end, which is actual coliider

here you can see that collider box exists in blueprint trigger back, so why is it getting a null value? where tdid i go wrong?

i should also mention, that i did check editable check box. however, i could not see “default” tab as given in solution way above.

Did you also check “Expose on Spawn” box in variable properties? It is a few lines down from Editable check box.

it wasnt checked. i checked it, played level, and i am getting same error again. is there a different way i should be using for multiple overlaps?

Hi!. i cheacked out Casting method, and it worked like a charm! thank you for your help!