I want to make a level where the player is inside a train, which is moving along the traintracks. Now since the track is very long, or possibly endless, I think the best way to do it is by moving the world around the player / the train.
Now my question is, how to do that the most efficient way? I found the “Get all actors of class” and “Get all actors with tag” functions, but it says “This is a slow operation, use with caution, e.g. do not use every frame”.
So how can I then move all the actors every frame, without heavy performance losses? Like store all the actors in an array and use that to specify which actors should be moved?
If that’s the way to do it, what is the limit of an array?
Or is there any other efficient method that does not result in real performance loss?
EDIT: As of the question of Tearl, I use a blueprint system to procedually spawn mesh tiles in front of the train (in a certain distance) and foliage (trees, rocks, etc) on top of them. So perhaps I could just move the map tile actors?
I hope you can help me out with this, thank you so much!