Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placement Objects System #12

Open
PanchoL opened this issue Nov 8, 2019 · 1 comment
Open

Placement Objects System #12

PanchoL opened this issue Nov 8, 2019 · 1 comment

Comments

@PanchoL
Copy link

PanchoL commented Nov 8, 2019

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.

@VincentLagerros
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants