- Home /
Unity 3D: How to do terrain chunking?
I want to make a terrain mechanism that will work according to my character's position. I am only working on the y-axis. And the fundamental composition of my game is, that my character(a sphere) goes up in the y-axis on tapping, and as I am on the y-axis as soon as I stop tapping no force is applied in an upward direction and gravity kicks in so the sphere starts falling.
What I basically want to do is, I have made Crossy road type roads and the sphere will go up and there are cars incoming from the left and right direction on these roads(terrains) and I want that as soon as my player goes up and gets to a specific position, say (0,10) I want the terrain mechanism to kick in and lock the gap from the first and last terrain, like at (0,10) position of sphere, there are 10 terrains below it and 10 above it. And from now on I want it to go up in chunks, like say if the player moved to (0,12) then the terrain at (0,1) gets destroyed and new one spawn at (0,2), and the same happen at the top. Kind of like min and max, like if position is (0,15) min = (0,5) and max = (0,25).
All my terrains are prefabs.
I am kinda bad at explaining so I explained in the word file below. Please check Please answer, I would really appreciate it.
[Detailed] https://drive.google.com/file/d/1iDmaq-8hGVPNldbpM81axYaJ1PXVcDoo/view?usp=drivesdk
Your answer
![](https://koobas.hobune.stream/wayback/20220613011747im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to use a C# framework/library with Unity 1 Answer
Why don't I get highlighted words and do not get tips/any help? / Visual Studio problem / C# 1 Answer
Destroy just the last child from a parent after the child hit a trigger 0 Answers