How to keep objects in place on infinite terrain?
Hi, right now I have an infinite terrain system. When the player walks forward, new terrain tiles are generated, and the terrain far away from the player is destroyed.
I also have randomly generated rocks on the terrain. My problem is when I walk to new terrain, and then go back to the old deleted terrain, the rocks are all in new places.
This is my code to generate each section of terrain (Rocks are placed in this script).
And this is the code to continuously generate the terrain.
This is the object pool for the rocks, if this helps at all.
What are some ways I can keep the rocks in the same positions when I go back to old terrain? Any tips or tutorials is appreciated. Thanks.
Your answer
![](https://koobas.hobune.stream/wayback/20220612094050im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Generate structures on procedurally generated terrain 1 Answer
Optimize Terrain In Infinite Runner 0 Answers
Endless runner move terrain around player. 0 Answers
How to make infinite 2d terrain in unity and fill it with infinite box colliders at random places? 0 Answers
Use navmesh on infinite world (Mesh Collider Chunks) 0 Answers