How to add a Foliage on procedural Mesh

I know this is an old post, but I too am working on a similar project where the terrain is procedurally generated using perlin noise along with procedurally placed foliage + buildings.

Just incase anyone is still looking at this thread, the “Randomly Generated Foliage” post Olathuss linked is exactly what worked for me!

Basically you want to use the “GetLineByChannel” blueprint function (or respective c++ function call) to cast line traces downwards onto your procedural mesh component (pmc), which will be detected! From here you can simply use the hit info to spawn any meshes/foliage you wish. I do want to note that when using the pmc, many of its inputs are optional, I would recommend you atleast calculate the normals for your pmc as those were very useful when placing objects on slopes (also so that lighting looks good on your pmc :slight_smile: ) If you happen to struggle with the math, there is a “calculate tangents” bp function thats included in the pmc library that calculates both the normals and tangents for you.

4 Likes