How can I filter a certain array of actors by the condition if they are visible on screen?
If you get all the actors in the world (or retrieve your list of actors from elsewhere in your own system), you can use Actor->WasRecentlyRendered().
Thank you that helped!
Just curious cause im pretty new to arrays: Is the below the “right” or efficient way to make an dynamic array at runtime?
Well, I see you are doing it on Tick which happens many times a second, you should try to minimize the amount of things you do on Tick.
It also looks like you have a second array for “visible” focus actors. if the array on the left already contains unique elements, you could simply empty the array on the right and use the “Add” node to add new elements to that array if the actor of the left is visible. This safes some operations (AddUnique, Remove).
no the Clear node would happen before you run the ForEachLoop. Otherwise it empties after all elements have been added. You also don’t have to call the “Set” node within the loop because you already added elements to the array.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.