Why isGet Components by Class always yielding array length of 20?
Can anyone explain to me why this is happening?
I have a level with landscape and an instanced foliage actor containing several hundred instances of a grass static mesh. When I use a Get Components By Class node, the output array always has a length of twenty, which means I must repeat my function many times if I have more than 20 instanced mesh components. I have tested with the class set to both FoliageInstancedStaticMeshComponent and InstancedStaticMeshComponent with the same result. I have also removed the painted foliage and started over. The array length is always 20.
Why is this happening? Is there a limitation in the way I can query the instanced foliage actor?
I am using the approach described here to remove overlapping foliage instances. It work well except for needing to fire the function many times to clear all the overlaps.
asked Oct 25 '18 at 03:03 AM in Blueprint Scripting
Got it! I was just confused.
Get Components By Class will output 1 element per foliage type you have painted with.
In the example image I posted above, Get Components By Class will return an array of the Foliage Types you have painted. So if you only paint with a single grass mesh foliage type, your array length will be one. If you have painted with 20 different foliage types, then the array length will be 20.
From there using a loop I test overlap for each foliage type and then remove instances of it.
answered Oct 25 '18 at 04:53 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here