- Home /
Terrain generation problem
I am practicing with Unity and I have an issue with dynamic terrain generation.
I hope the image will explain better what was in my mind while creating generation script.

I have created prefab which contains ground plane(marked as G) and 2 coliders - one to destroy part of the terrain(marked as D) and one to create another part (marked as C).
So the game start as on the image. When car reaches D2, G1 is being destroyed. When Car eaches C3, another part of the terrain is being generated right after G3. And so on and so forth. The camera follows the car so this makes an illusion of infinite road. The problem is that even tho ground planes are perfectly aligned, the car starts bumping when reaching gap between two planes.
Is there any better way to generate such flat terrain or should i just create one plane in size of lets say 10k and hope that player will never reach so far?
I've seen this issue come across this list before and haven't seen a satisfactory answer. One way to approach the problem would be to generate triples and slide the terrain. So you start the game with G1/G2/G3 as a single unit/mesh. As you hit point D2, you generate a new terrain G2/G3/G4 and reposition either the car or the terrain so nothing appears to have moved/changed.
Your answer