Adding several actor type to a single "actor" array?

I’m trying to make a array of objects for my linetrace to ignore.
Though as the input this only has a single array input value.

To create the array i have several types of “get all from class” checks at the start of the game that then perform relevant checks to see if they should go on the “ignore” list. (since the game contains a lot of objects this is an automated process based on tests like “is simulating physics” or the type of material or some other relevant statistics)

Though this ends me with multiple arrays of various actor types. However they are all a subtype of the “Actor” actor.

Is there a way that lets me add “BlueprintActor array” and “Static Mesh Actor array” and “Skeletal mesh array” and “Pawn Actor array” to a single “Actor” array ?

This is certainly possible.

There are just some things to consider:

  1. If you use the “Get all actors of class” node and you plug it into the “For Each Loop”, it won’t take any other type of array anymore. So changing the actor class in “Get all actors of class” afterwards will essentially break the “For Each Loop”. Solution: Just delete the Loop and spawn a new “ForEachLoop” node.

  2. Running multiple For Each Loops will probably kill a lot of performance when executed. If you use them at the level building phase or right at the beginning, there shouldn’t be a problem with it. Loading screens should have their place too :).

OPTIONAL: If you want to do it in runtime, you could also use a manual loop, which isn’t trying to force the game to add to an array at every frame. You just decide the delay, which gives you the freedom to decide, how many seconds/milliseconds it should add an object to the array.