How do you guys approach making an endless runner? The coding part to be exact?
I plan making a array to store static meshes and each few seconds check the location where the player’s character is present. If the static mesh is behind the player, I plan to destroy it, remove it from the array and create a new static mesh in the most front part.
I plan to have infinite left and right movements in the endless runner so I am going to need to spawn a lot of platforms dynamically. Other than that, any suggestions?
I’m not entirely sure, so don’t quote me on this, but if you made an endless runner, I don’t think space in Unreal is infinite.
The way I’ve seen many people approach it is by keeping the character still, and then spawning/deleting meshes based on distance.
The speed the meshes move towards the player is based on the player “Speed” (Which is just a ‘FVector’). Noting that the player is still standing still.
There are actuallylive dev videos on youtube, going about making games like Temple Run etc, which cover this idea a lot more thoroughly that I can at the moment.
Sorry I’m not of much help! But I wish you luck, and will help further if I can!
Every tile you create needs to have a box collision at the end that overlaps with player character. You also need to keep track of the last location that a tile needs to be spawned at. In the beginning of the game, you can spawn 5 tiles and then every time player character overlaps with the box collision you create another one at the last location.