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"

How to avoid adding Trash_Components to array?

Hello! I hope you can help me. For example of problem I create a simple Blueprint and in it's ConstructionScript I made loop that adding StaticMeshComponents to array. I promote that array to variable (SMC_Array) and made it public. The problem is: When I'm moving my BP in Editor Viewport, I can see that many components are adding to my array. In Details panel I can see names of that components: TRASH_StaticMeshComponent (and after some time their names change to None) and the StaticMeshComponent that I really need - Pillars 50x100 in my case. When I'm tried to use SMC_Array in another BP, without removing this unnecessary components Unreal begins to take too much memory and sometimes crushs. I can click Remove All Components in the Details panel and this bad components will dissapear and everything will be Ok (untill I don't move my BP again) , but I can't do this all the time - this isn't a solution. I tried to resize my array by last loop index, but in some cases i still see that Trash_Components are in the middle of array. I also made many BP using ChildActorComponents instead StaticMeshComponents and have the same problem - Trash_(SMesh,ChildActor...)Components in array. How to avoid this and still have access to each added component via array? Thanks for your answers!

alt text alt text

Product Version: UE 4.8
Tags:
editor.png (940.4 kB)
more ▼

asked Jun 16 '15 at 08:28 PM in Blueprint Scripting

avatar image

TVinforest
459 15 13 23

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

If you have haven't got this yet, you can simply fix this by setting the array to nothing with a make array, remove the default pin in that, and it will work, the only problem every time you move it it will update. You can stop this several ways, the easiest is to put a branch and have an exposed var that says allow it to make new static mesh components or don't.

However, you could do a check to see if your static array mesh == your desired amount of static meshes. If it doesn't, add to the end of the array until it does with a forEach loop starting at the length of your current array plus one, and if you have to take away, use a while loop until the number of instances in your static mesh array is no longer greater than your desired amount.

more ▼

answered Jul 01 '15 at 12:51 PM

avatar image

James94Hodges
26 3 3 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

If you have haven't got this yet, you can simply fix this by setting the array to nothing with a make array, remove the default pin in that, and it will work, the only problem every time you move it it will update. You can stop this several ways, the easiest is to put a branch and have an exposed var that says allow it to make new static mesh components or don't.

However, you could do a check to see if your static array mesh == your desired amount of static meshes. If it doesn't, add to the end of the array until it does with a forEach loop starting at the length of your current array plus one, and if you have to take away, use a while loop until the number of instances in your static mesh array is no longer greater than your desired amount.

Let me know if you get it and if you need blueprints on it I can assist. Actually, I made a video doing some very similar work but haven't post it yet. I'll send the link when I do.

more ▼

answered Jul 01 '15 at 12:56 PM

avatar image

James94Hodges
26 3 3 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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