How can I get nearest foliage?
The trick with foliage is that InstanceFoliage is a sub-class of InstancedStaticMesh. If you cast your foliage to a instancedStaticMeshComponent, you can perform all the usual instance functions. Don't forget foliage has NoCollision set by default, so give it something.
In the screenshot attached I am getting all actors around me, and printing their transform. If you want to get the nearest foliage, you could get those around you and store them in an array, and sort the array (various posts on here for sorting arrays or finding closest). The HitItem pin on a hitResult returns the index of the instance.
answered Aug 21 '17 at 01:25 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here