Hi,
I wanted to create a custom material BP for level landscape. In the material, I wanted to create a “parameter” that could change the material attribute such as base color.
How can I access the landscape’s material parameter from my 3rd person character BP. For example, if I click certain key, I wanted the 3rd person character BP to access the landscape material parameter and pass in a new value.
GetActorOfClass(Landscape) > Landscape Material > Create Dynamic Material Instance > Set Vector Parameter Value.
You should do the first 3 steps on Beginplay and save the dynamic material inatance as a variable to save doing it each time.
In the Third Person BP, when I use the BP code below. When I press “E”, I am not able to change the MI of the landscape’s MI parameter, but I am able to see the print string:
I just checked it out, and it works! Material Parameter Collection seems like a really useful method to use. Since it can be attached to any material, those parameters can be used to change multiple materials at the same time with a single parameter from a BP.