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 create array from Static Mesh actors in a blueprint?

alt text

I have like alot of actors within this blueprint an many other that i need to change materials to. Previously i would connect each one in the target point however im fed up with it and tried to create an array but with no success. Can someone tell me of a better way to do this?

alt text

Product Version: UE 4.17
capture.jpg (78.7 kB)
1.jpg (262.5 kB)
more ▼

asked Jul 26 '18 at 01:24 PM in Blueprint Scripting

avatar image

1 2 3

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

1 answer: sort voted first

You can use the method in the first pic, just run the output through For Each loop - this will iterate through every element in the array Get All Actors Of Class spits out. That's for actors.

For components:

You manually add them to an array using Make Array node. Create a variable of the desired type and turn it into an array - looping with For Each node will give the iterations. You need to do it only once but you can have more than one array. You can have the same object reference stored in more than one array if needed.

Yet another way is to use tags, Get Components By Tag node returns a filtered array.

If you need something more complex (run-time only, though) use a collider and Get Overlapping Components. -> For Each.

more ▼

answered Jul 26 '18 at 01:36 PM

avatar image

15.3k 77 26 62

avatar image kIRIL1g Jul 26 '18 at 01:42 PM

![alt text][1]

It still gets the job done on only one of the meshes present within this blueprint! [1]: /storage/temp/248616-2.jpg

2.jpg (303.5 kB)
avatar image Everynone Jul 26 '18 at 01:42 PM

Read the rest of what I said. :) You need to group the components in the Kitchen BP - you only need For Each there if you have more than kitchen.


Do something like that in the Kitchen:

alt text

And then call the Custom Event

capture.png (130.2 kB)
avatar image kIRIL1g Jul 26 '18 at 01:48 PM

Is there a way to connect all these static meshes at once? That was the initial request. Otherwise if i do it i again like this it will still take me alot of time. If there is no shortcut to connect them instantly than manual jobs it is than! :(

avatar image Everynone Jul 26 '18 at 01:51 PM

Yes, use tags.

alt text

You can click+shiftClick to get a list of components and give them tags. And then GetComponentsByTag.

edit: something like that

alt text

This way you do not need to store anything in the array. But that's up to you.

capture.png (85.4 kB)
capture2.png (98.0 kB)
avatar image kIRIL1g Jul 26 '18 at 01:54 PM

Now we are cooking :) Thanks for taking up with my silly questions :)

avatar image Everynone Jul 26 '18 at 01:55 PM

No problem. Good luck.

(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