- Home /
Endless 3d Background
Hey! I am working on a game where I need a 3d-endless background to simulate driving. Does anyone know how I can get an endlessly repeating prefab? (the Prefab should dissapear after some time or something because of the performance)
Thank in advance, Finn!
Answer by landings · Mar 28 at 12:39 AM
You can use prefebs that can be pieced together. For example, you can make 3 prefebs, a straight road, a left turn and a right turn, and these 3 road section types can form a boring infinite track. If you have more variants, your track will be more attractive.
Only blocks that are close to you will be instantiated and kept live. Blocks too far away will be destroyed.
The block types can be determined by the hash value of the road section index and by some extra rules to avoid short-range self-intersection, so they look random and are always determinant.