Is it ok for me to use get all actors of class like this?

So I read the description about get all actor of class. It said that don’t use it on every frame since it is very slow operation. So is that mean don’t tick it? Or did not misunderstood what every frame means?

Is there any replacement of get all actors of class except for cast to node?

Thank you for helping me out! I tried to find another way but I couldn’t find one so…

Event Tick is called every frame. If you want to not do an operation every Tick, you can store a counter, and increment it, then branch every… ten ticks.

I wrote this macro DoOnceEveryN to do just that… So I can do some task every N times it tries to execute.

200578-ue_answerpic3b.png

Edit: (This version doesn’t work if you set N to 1)

Cast to node doesn’t get actors, it just makes a more specific container for an object you already know about.
I don’t believe there is a faster way to get all actors of a specific class.
I suggest maintaining a local list of all the actors you need to know about, and refresh that list every… 10…60 ticks.