How to use a material parameter value to control something else?

Hi guys! Just wondering if anyone knows how could I get a material parameter for using in another blueprint to control something else?
I’m having a huge object that applied a material and I want to make an other small object to move its position following the huge one’s surface changing
I don’t know how to get the value from the material instance and use it in a blue print.
Please help!

You could create a Material Parameter Collection. Those can be changed in blueprint, and when you do that you could add a binding that would change something else happening. If the material is using something like world coordinates, you could take the parameter that is a vec4 and use that information to drive other parameters.

In blueprint you need to create a dynamic material instance that is applied to the mesh when used. From this you can use the reference to the dynamic material instance to change parameters like floats, vectors and textures.

1 Like

Hi! Thank you for your reply!
So if I use parameter collection for example for the value that I want it to drive something else, then could I still control this parameter in the material instance? Or if I want to change this specific value I have to go to the collection to do it?

You can hook up the material collection in both materials and to drive blueprint values (think of it as a shared control hub)

2 Likes

Still cannot figure it out how to do it :smiling_face_with_tear:
I’m too unfamiliar with nodes

The Material Parameter Collection (MPC) is an object on it’s own. It’s something that can be read from a material-shader, or other blueprint, and settable from blueprint.

You cannot set the value inside an MPC from a material-shader.

What the responders above were pointing out is that since the material-shader is a consumer of the MPC, you can use something outside the shader to set the value in the MPC, and whatever else needs to pivot off that changing value can also then read it from the MPC. The multiple things would be in-sync since they are all reading the same value from the same, single place, the MPC.

Otherwise, if you just have a value inside a material-shader, like a local scalar, it’s only valid inside that shader. Taking the value ‘out’ of the shader and putting it into an intermediary-container, the MPC, lets us share it.