How can i change material color of multiple objects inside blueprint?
I'm spawning a grid inside my level https://i.imgur.com/LrMcZo2.png
Then im creating onHit event for every static mesh created by macro. https://i.imgur.com/DswKFnm.png
Now every player have assigned different color (e.g. player1 : blue, p2: red etc.), so instead of duplicating same material over and over for X colors i want to assign base color based on player color.
As you can see in BP screenshoot i want to replace 'set material' with something that will allow me to change base color of material. I know i can achieve that by using 'set vector paremeter value' , but i dont know how to exactly create dynamic material instance and then call onHit to change color of exact object that character just hit.
asked Apr 17 '18 at 09:27 PM in Blueprint Scripting
You were on the right track with Dyanmic Material Instance. If you create a dynamic material instance in the construction script with a material instance that has exposed parameters for the values you want to change.
Then you can simply change the parameter whenever you want, even lerp it if necessary.
Follow this question
Once you sign in you will be able to subscribe for any updates here