x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Why isGet Components by Class always yielding array length of 20?

Hello,

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?

alt text

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.

Product Version: UE 4.18
Tags:
more ▼

asked Oct 25 '18 at 03:03 AM in Blueprint Scripting

avatar image

LoneScrapBot
25 3 3 5

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Oct 25 '18 at 04:53 AM

avatar image

LoneScrapBot
25 3 3 5

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question