change material in blueprint

I have a code that randomize the color of an actor, but now I want to do something where when I touch that actor in game it uses the material that was affected to it and increase the green level in it. How can I do that ?

To change parameters of an individual material at runtime, you’ll need to convert the materials to dynamic materials. This has to be done at runtime, and can be done like so:

Then, you can change the parameters by casting the material to dynamic and using these functions:


For changing color, you’ll want Get/Set Vector Parameter Value

The Parameter name is the name of the parameter in the material.
For instance:
image
This would be a vector parameter with a name of “Some color parameter”

1 Like

this works very well thank you

1 Like