Change materials to all the elements from an array
Hello I’m trying to get some help about this problem: I want to apply different materials to different mesh actors according to which button I click on a screen widget. Finally and thanks to many tutorials I achieved my goal, except for a little inconvenience, in order to change the material I must click many times the same button so the material change takes effect one by one on each of the mesh actors. I think this is because I plugged (widget blueprint) a “random integer in range node” into the get node which in turn is located between the “array variable reference” and the “static mesh target”, so I suppose that this “random integer node” gives a random index number per click, and this number decides to which of the “make array node” (in level blueprint) elements is going to change the material. Could somebody please help me to make the material changes to all elements from the “make array node”?, please, I’m really new to this.
Thanks in advance
Have you tried using a ForEach Loop? This would allow you to perform the material change for each element in the array. Have a look at the documentation for the ForEach node and see if it's what you're looking for: https://wiki.unrealengine.com/Blueprint_Essentials_-_12_-_For_Each_Loop
answered Oct 06 '15 at 06:00 PM
Sean L ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here