I have a placement system for nature elements in my game like trees, flowers, bushes, etc. It uses rng and raycasting to pick locations for the objects. I’ve run into an issue with placing grass patches where it looks strange on steep terrain.
Is there any way I can limit specific objects (like grass) to only be placed on flatter land without having to define specific area of the map? (because I might change the terrain later on)
Use the normal vector of ur raycast result
Does your terrain generate use perlin noise, because if so you could get the noise of the 2 point 1 x over and calculate the slope then if that slope is above a certain degree don’t place the grass.
No the terrain doesn’t generate with Perlin noise, it’s handmade.
Hmm I would probably raycast to get the height of the terrain down from where you want to place it then, calculate the slope.
What do you mean by this? Like get the height of the flat terrain?
Like get the height of the terrain below where you want to place it, so if the terrain is at (2,5,1) raycast from (1,1000,1)