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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Have blueprint execute on multiple objects?

I have an environment which has many static mesh components.

I want to be able to change the material on a key press.

I have successfully created a blueprint for one of the objects to change the material when a key (0) is pressed and it works great. However, I'm struggling to get it so I can run it on all of the objects I want to.

I thought I could select all of the objects and create a static mesh and then create a blueprint for that, iterating over each object in the mesh, but I can't create a static mesh of the objects.

I'm very new to using unreal, any help is appreciated.

alt text

Product Version: UE 4.19
Tags:
world.png (517.4 kB)
blueprint.png (102.2 kB)
more ▼

asked Jul 12 '18 at 05:36 PM in Using UE4

avatar image

NextSim
1 1 1

avatar image NextSim Jul 12 '18 at 05:55 PM

Update: I was able to get objects into the same blueprint.. but looping over them isn't working.

My blueprint is attached

alt text

blueprint.png (217.8 kB)
avatar image wyyz Jan 02 '19 at 03:48 AM

Thanks, you solved my problem~

avatar image Nebula Games Inc Jul 12 '18 at 06:38 PM

I was gonna recommend what you just did haha So what is the issue with the loop not working? Do you have multiple materials on the objects because that loop as it currently stands will only change the first material at index 0 on each object. What specifically are you trying to do?

avatar image VolatileAgent Jul 12 '18 at 06:46 PM

I noticed the material you are setting is different between your examples. Was that intentional?

avatar image NextSim Jul 12 '18 at 06:57 PM

yeah, the bricks is easier to see that it changes.

avatar image NextSim Jul 12 '18 at 06:56 PM

I want to be able to press a key (eventually one of a few) and change the material on several objects (to the same material).

There is only one material on each object ( I think).

With the set up above, none of the material change. If I do the same thing with the original blueprint the material changes, in fact I can set up a few different key press events and have a different material selected for each, and the material on the object changes as expected.

It's when I try to do it in a loop for several object that nothing is changing.

I tried casting each object to a static mesh actor after the for loop and passing that to set material, but static mesh actor doesn't inherit from static mesh component.

alt text

object.png (70.2 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Well.. not sure what was going on.. but it's working now.. thanks

more ▼

answered Jul 12 '18 at 07:11 PM

avatar image

NextSim
1 1 1

(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