I am making an Endless Runner game for mobile in Unreal similar to Subway Surfers. I am having confusing on how to spawn obstacles or a correct way to make variants of obstacles layout.
My setup:
First I made a MasterTile_BP, and then created a child BP out of it and inside I added the multiple child actors of “Obstacle_BP”. I placed different types of Obstacle_BP inside a child bp of a Tile and made multiple variants of Tile_BP and then randomly spawning from the child BPs of Tile. This is working but I think having multiple child actors inside a blueprint and then frequently spawning and destroying is heavy, especially for a mobile.
Then I tried to change my setup, I removed all child actors from Child BPs of Tile and instead added arrow components and placed them inside the variants of Tile BPs, (And also added Tags on the arrow component to tell which arrow spawns which obstacle). This setup is also working but because of spawning/destroying, it will become heavy.
What is the correct way of making obstacles/obstacle layouts? Should I randomly generate them? Or are they pre designed? If they are pre-desinged then where do I design my obstacles layout? Inside a child BP of a Tile and add them as child actors? Or how?