Make Mesh Always On Ground? (Procedural Generation)
What do I need to add to the construction script to make sure the meshes are always touching the ground? I'm trying to do EXACTLY what a procedural foliage spawner does, but using a blueprint actor rather than a foliage type.
Any other advice on how to recreate foliage spawner in a blueprint would be greatly appreciated! Thank you!
I'm using UE 4.18
asked Jan 30 '18 at 06:08 AM in Blueprint Scripting
First you have to randomly generate a location above the ground, like you are doing already. Then, from that location, use LineTraceByChannel to fire a ray downward (negative Z direction) to the terrain. Get the Hit Results from the line trace and extract the Location (or Impact Point). That is the location on the ground where you need to finally spawn your foliage mesh.
answered Jan 30 '18 at 07:50 AM
It might be too simple but, can't you use an static navmesh and use to get random locations to spawn?
answered Feb 01 '18 at 04:14 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here