Changing material based on actors blueprint parameter.

What would be an efficient way to apply materials to a mesh inside my actor that uniquely correlates to the actor’s public value “Door value”?


rW3DlxYNuw
UnrealEditor_JBxQWl9vTz

rightclick your blueprint graph and type in “select”.
At the very bottom, you find the simple “Select” node.
Add it to your graph in whatever function/event you like to swap materials (if the value is defined via detail panel or spawn, do it in the construct function).
As Input of the Select, set your DoorValue Variable.
now… drag your Mesh Object from the Component List into the Graph. This creates a Get Node for you. from that, drag a new Node by typing “Set Material” into the Context Browser.

The Target if this Node should be your Mesh.
The Input Material should be the Output of the select Node.

You now can add more values to the Select with the “+” Button… and give each value a different material.

2 Likes