x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

How can I check for a trigger overlap when it is generated [Blueprints]

I have a project where a stage is randomly generated, it consists of pre-made rooms. Some of the rooms can have a trigger box to check if the player is in it. But from what I know a trigger OnBeginActorOverlap can only be set in the Level Blueprint, so it has to be present at the start.

How would I go about adding behaviour to generated trigger boxes OnBeginActorOverlap? Can this be done without using the Level Blueprint?

Product Version: UE 4.21
Tags:
more ▼

asked May 09 '19 at 08:31 AM in Blueprint Scripting

avatar image

TwinGhosts
8 1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Event Dispatchers is the first thing that comes to mind. You can register events from any actor like so:

alt text

Here, the Third Person Character will receive a call from the room whose box gets overlapped, the Room actor will send the listed data. That's the default behaviour, if you wish to push more data from a room, you can create your own custom dispatcher and have the room call it when the box overlap triggers.

You can bind / unbind events dynamically and any number of actors can register with the same dispatcher.

edit: in the screenshot I do it with a component, you can do it with the entire Actor, of course. Or any of its components.

capture.png (142.2 kB)
more ▼

answered May 09 '19 at 08:39 AM

avatar image

Everynone
14.7k 76 25 61

avatar image TwinGhosts May 09 '19 at 08:57 AM

Thank you for the quick and detailed answer! I really appreciate it.

So I've been trying to get it to work and I see progress already, but how would I get that event you have linked into "Bind Event to..." part?

Is it a custom event?

Edit: It is I just can't read... My bad, thank you! I'll try and see if it works now.

Edit 2: I got it to work, thanks a lot!

alt text

node.png (54.7 kB)
avatar image Everynone May 09 '19 at 09:14 AM

Ah, yes! I should have mentioned it. Assign will auto-create an Event with the correct signature.

Good luck!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question