Single trace to find multiple BP actors?

Hi. I have 4 BP with static mesh stone. I would like NPC to find that stone and do something.

I am doing multisphere Trace by channel, and then casting to stonebp1 to put it in array.

Can I in single trace for something like group of BPs (maybe parent, but find all of it’s children) that I want to check, or just do 4 different casting(to stone1, stone2, stone3, stone4)…

If anybody have idea, just point me in some direction please :slight_smile:

I am by no means an expert, but I may have an idea. If the static meshes you’re grouping are in the level at start, you should be able to go into the world outliner, select the actors/meshes in there you want to group, and right click over one of the selected objects. In the drop down menu there is an option for grouping. I’ve not played with this myself, so I can’t promise this is right for you, but it seems like a good start. Click link for documentation.

And here’s the option in the menu I’m referring to:

Thank you very much for the idea. I will try it out :slight_smile:

Absolutely! Hope it helps solve your conundrum, Bodul! :slight_smile:

You can always use the node “Get All Actors Of Class” and choose the parent class and it will find all parents and children in the world. Use this with extreme caution! You should never put this node into a Tick event and if you have many of that class in the world it can drop FPS drastically. Depending on how you are doing everything and why you are doing it, you could always use Perception and/or EQS. Problem with Perception is everything needs to be of type Pawn or Character to use perception and with EQS it only returns the one best choice based on conditions you set.

It sounds like you want your NPC to find the closest stone and go mine it or something? If that’s the case, EQS is the best option for this as this is exactly what it was deigned for and will run faster than most plain BP’s you design by hand.

Hope this helps! If it does please consider accepting the answer by clicking the check mark next to the answer! Thanks!

Thank you. I did find Cast to GroupActor, so I played around with that, however casting was failing.

At the end, I created interface Stone, and assigned that interface to every blueprint that I wanted to find. Then I am searching for that interface.Doing the same thing as “Get All Actors Of Class”, but I wanted to have something to easily add to future blueprints that gets eventually created, and needed same functionality.

On the other hand I am glad that you answered this question, since you are the one with the RTS tutorial that got me very interested in this engine. Now I am loving it :slight_smile:

Thank you!!!

Yes NPC finds closest stone and collect it, resources are finite, so after some collecting I am destroying resource. I am filling array, but I am also clearing after, some time. First idea was that i scan once on game start, put all in array, and then remove one by one as they get destroyed.

I did something similar with trees, and so far it works, but I will have to put much more trees and stones around in the level to really test it.

Having finite resource on map makes things a bit easier, except for trees since I am periodically spawn new ones so when that happens, I am clearing array and filling it again with updated information(and I am certain that there is better way of doing this).

I am still learning this engine and bluescript so I am sure that there is better way of doing things.