Alternative to "Get all actors from Class"?

It IS intensive. To get round this, you need to store an array of the spawned blueprints (usually in the level BP, or the player BP, depending on what the listed BPs are), and then loop through it. You need to keep track of when to add to, or remove from, this list, but the overhead is massively less than GetActorsFromClass.

The overhead of GetActorsFromClass comes from it looping through ALL the actors in the game, and returning an array where the class matched. If you create the array and maintain it yourself, the game doesn’t need to loop though all the Actors, and you save yourself the massive number of operations required to do this every time your reference it.

4 Likes