Download

Triggering multiple events with a single trigger volume?

I’m building a level in which the player character steps into a trigger volume, prompting a formerly motionless AI NPC to start walking around:

OnActorBeginOverlap(trigger volume)–>AIMoveTo (in which the pawn is the NPC, destination is a target point placed elsewhere on the map).

It works well and fine with a single NPC, but is there a way to activate multiple NPC’s upon entering a single trigger volume? Obviously I can just set up multiple trigger volumes, one for each NPC that I’d like to activate, and just place all the trigger volumes in the same spot so that they’re activated simultaneously, but that just seems so crude. I’m entirely new to UE4 and blueprints, but I fail to believe there’s not a more elegant solution.

(If you have it in your heart to offer up a solution, please be gentle. I’m not too up on all the terminology and know next-to-nothing about what I’m doing, haha.)

Use a child class, or ‘all pawns of class’
(I’m not great at this stuff but if you use all of class and they are all the same class or children of a base class it should work.

@jay_adams_11 Ooh getting closer. I wasn’t aware of GetAllActorsOfClass. Still can’t figure out where it fits into event graph, though. If I have an **OnActorBeginOverlap **node for the trigger volume, and it’s feeding into AIMoveTo, where in the chain would I plug in GetAllActorsOfClass?

Before the move to. And you would for each node into the move to, with the complete pin perhaps going to a different function/node.

[USER=“3140864”]MostHost LA[/USER] Much appreciated. So do I run the white exec pin from OnActorBeginOverlap into GetAllActorsOfClass, and then from the latter into **AIMoveTo? **I’m unsure what to input as the pawn in AIMoveTo. I’ll upload a screen shot below; mind pointing out to me where the error lies?

Can’t really read that, too small/blurry.

Ideally, get all actors of class will return an array.
you loop through the array via for-each. This will usually provide you a pin with the reference to the actor and the index.
you plug that result into the move to as the pawn/ai/actor to move.

Also, obviously the pin from the overlap needs to be assigned to the get all actors of class in order to actually execute that node…

[USER=“3140864”]MostHost LA[/USER] haha I guess that is pretty difficult to make out. Here’s what I currently have going on:

**OnBeginActorOverlap **is pinned into GetAllActorsOfClass. I made a reference to an AI which is pinned into GetClass, and GetClass is then pinned into GetAllActorsOfClass. GetAllActors is pinned into AIMoveTo, which also has a target point plugged into it. GetAllActors does have an array, but I’m unsure what to do with it…

“you loop through the array via for-each. This will usually provide you a pin with the reference to the actor and the index.
you plug that result into the move to as the pawn/ai/actor to move.”

Could I persuade you to further clarify that statement? (Or just tell me to fuck off, haha. Im such a noob at all of this and am probably being really annoying)

Drag from the array pin and type For, find for each in the result.
then from the for each element you can draft off and find other options.

I would suggest you have a look at the blueprint basics class inside of the Unreal academy.
hit the learn tab at the top of this website, log in, and search for Blueprint.