Hey!
I’ve got a problem and only unsatisfactory solutions come to my mind. Ok, let me explain this.
I am using Perlin Noise to generate the terrain. I want to spawn the terrain blocks piece by piece (just like Minecraft does). I don’t want to instantiate big terrain at once, because on each piece I will make calculations to make it more differential. How can I detect, if I need to generate particular part of terrain at given moment?
Imagine yourselfs the terrain divided into squares. How can I check if I need to instantiate each of squares?
Here’s my not-exactly-solutions:
a) Four variables (north, east, south, west) for keeping informations, how far player went in given direction and if it is less that current position (+ draw distance) I am spawning chunk. Defect of this method is, I can generate terrain only in four directions, I cannot detect anything between that (it looks like +).
b) Triggers on the terrain borders detecting player collider. When the trigger is fired, I am generating terrain part behind it. It is hard to explain with my english skills… Defect is, each square part of the terrain can be generated by touching four surrounding borders, so it might generate terrain even four times.
Have you got any sugestions or ideas?
Corrent me, if I am wrong. So I have to keep all the instantiated chunks in the two-dimensional array (or any other container). When the player will reach the Draw Distance, I must Destroy chunks behind him and Instantiate chunks in front of him. I am not sure if searching the array is good and fast solution. I may be wrong of course.
– BartoszCurrently the jump is depending on the swipe size also can not understand why, since they define a specific value. The jump is not to depend on the size swipe, in case if the player makes a swipe greater than the set, the jump must be the same size.
– niick555