Activate Triggers

hi, i am new in UE4 and i have a question :
i have 4 triggers, and the 5 trigger will be activated only when player will pass trough all 4 triggers, for example the door will not open if the player don’t overlap the rest 4. Can someone show me the blueprint ? or some quide? THX!

Do you want a quick-and-dirty solution, or one that is flexible and reusable? They are a bit different.

i don’t want my game crash, so i think the flexible one is better ,but if you want you can show me both ways

Upon re-reading your original question, I must add another question myself before being able to provide a solution. There are at least four different possible interpretations here:

A) You want the fifth trigger to do something only if the Player Character (singular) has first triggered the other four triggers at least once, but the order in which those were triggered is not important.

B) As A above, but the first four must be triggered in a specific order.

C) You want the fifth trigger to do something only if the other four triggers are currently and simultaneously overlapped by the Player Character (which is very large, or maybe a snake-like object)

D) As C above but the other four triggers are currently and simultaneously overlapped by some other actor type, for instance some sort of item that has been placed there by the player, in each of the volumes, similar to Portal where you must have multiple “floor-buttons” pressed at the same time, using “weighted cubes”.

So… which is it? Pick one, or add your own.

i have 4 triggers , and they will be overlaped only by player. There will be no order , just need to overlap all 4 triggers to activate nr. 5 (similar to A )

OK…

This example is based on the first person template. If you are using some other player character, make the appropriate change in the casts right after the overlap events.

Step 1:

Make two new blueprints based on Actor. Name them MasterTrigger_BP and SlaveTrigger_BP respectively:

Step 2:

Edit the SlaveTrigger_BP by adding a Box Collision component. Replace the default root of the actor by dragging the Box on top of the root component until the tooltip says"Drop here to make Box the new root"

You can also add a billboard component (optional) to make it easier to select the actor in the viewport later on. Switch to the Event Graph tab and add a boolean variable named “HasBeenTriggered”, then set up the logic following the Event ActorBeginOverlap as follows:

Step 3:

Edit the MasterTrigger_BP and give it a Box Collision and a billboard (as above). In the event graph, add a boolean variable named “MasterHasBeenTriggered” as well as a variable of type SlaveTrigger_BP which you name “SlaveTriggerList”. The list should be an array, so check the little blue 9x9 grid button next to it in the details panel. It should also be Editable, so check that option as well.

Then set up the logic following the Event ActorBeginOverlap as follows:

Step 4

Now you can place the actors in your level. Drop a few SlaveTriggers and one MasterTrigger. Select the MasterTrigger and check the details panel under Default. You should see a reference to your SlaveTriggerList array, and it currently says “0 elements”. Click the plus button and add as many entries as you need (matching the number of SlaveTriggers. For each entry, click the eyedropper tool and select the SlaveTrigger you want to go in that slot.

Step 5

Testing! If you play in editor and walk around, the MasterTrigger should, if you set everything up correctly, and I didn’t omit some step by mistake, only print out a Success-message if you have passed through the other triggers first, otherwise it will print out a Denied-message. The place where the success message is printed in the MasterTrigger event graph is where you would place your own call to open the door or whatever it is you want to have happen at that point.

For extra credits add a reset function that sets all the slaves back to HasBeenTriggered = False.

Is’t work perfect !! THX,but when i try to add a refference to matinee, there is no “refference buton” or it works only with skeletons, meshes, etc. not with matinee?

Hm… I’ve actually never ever used Matinee for anything, so I don’t have an answer right now, but I’m 100% certain there’s a solution for that as well.

Is it the case that you are currently driving your door-opening sequence via Matinee? And then there’s some stuff in the level script that starts the sequence? Or… what’s the setup?

you (player) need to overlap the 4 triggers to open the door wich , yes is driving with Matinee, for example you find all 4 rooms, and after you find them ( this mean overlap the triggers ) the door will apear, or the wall will fall down, to make new way for the player.

Addendum for Matinee actions:

Step 6

Add a new Event Dispatcher to the MasterTrigger_BP (1) then attach a Call to that dispatcher after the last Branch node, on the True pin (2). You can name it anything you want, and just leave the Delegate and Input settings with their default settings (3).

Step 7

Open up your level blueprint and drag the MasterTrigger into it from the World Outliner so you get a reference to it. Drag off its reference pin and search for Assign Master… until you find the event dispatcher created in step 6.

50874-levelscriptassigndispatcher.png

This will automatically create a custom event that will be called whenever the trigger itself calls the dispatcher, and that lets you do anything in response to that. Hook up the Bind so it is called on BeginPlay.

In your case, you would drag your Matinee actor into the level blueprint and hook it up so that it can Play when the dispatcher is fired:

Gotcha. Added some stuff in a comment to the reply that will hopefully get you on the right track.

YES!! It work :slight_smile: , THX very much !!! i add a “overlap” node , and when player are walk in the door is open.
here how it look’s like