What is the main concept behind scripting endless runners?
I want to make a game that is kind of like an endless runner (actually more of a procedurally generated race), except, you won't be running, you'll be flying through pipes/tubes and stuff. So my question is: How? The way I'm thinking is that I:
- Make tube sections like: "Straight", "Right", "Up","Down" etc.
- Have a part in the section that detects when a player leaves the section using Touched
- Spawn the sections randomly using a table
- Remove a section when all players are out of it somehow (maybe using a part)
- Have a certain number of sections in a race that the code can't spawn anymore after the number has been reached
So does this look good? Is using the Touched event the best way to detect when players are not in a section? Because I hear things like RayCasting and Region3 thrown around so I'm not sure.
tl;dr
The main concept or game loop behind endless runners/procedurally generated tracks