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?
asked May 09 '19 at 08:31 AM in Blueprint Scripting
Event Dispatchers is the first thing that comes to mind. You can register events from any actor like so:
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here