Marching-Cubes icon indicating copy to clipboard operation
Marching-Cubes copied to clipboard

Placement Objects System

Open PanchoL opened this issue 5 years ago • 1 comments

Hello, I am interested in the terrain system and I wanted to implement a placement of objects (for example trees) these consist of frequency (how much probability that trees appear), size and prefab, all in arrays to edit each prefab , I tried to find the coordinates of each chunk to place the objects but it didn't work for me.

PanchoL avatar Nov 08 '19 15:11 PanchoL

I would raycast down from the sky when generating the chunks on the x,z axis via a 2d perlin noise. Then place a tree on that point it hit, set it size to random and seed it coords. This would generate a consistent environment with clusters of trees.

(If you want to add this, be sure to unload and load the trees when it chunks are updated, look at InitVisibleMeshChunks in the mesh generator)

VincentLagerros avatar Dec 08 '19 22:12 VincentLagerros