World Aligned Texture controlled by another object

I am trying a simple project but spending already one day trying to understand how to achieve it inside UE.

The goal is that the white cube X,Y would control parameters U_offset, V_offset from a instanced material applied on the plane. This would alight the cross texture under the white cube. (had to put all images in a single one)

2rd image is how I prepared the material (the function was customized internally with the texture - replacing the texture object node)

3rd image is how I set up the BP for the plane object. “Center” is the reference for the white cube.

Currently, nothing is happening when I play the scene. Not sure if this would be the correct approach to this…

1 Like

I think it’s the cast of the material, I assume it makes a new material.

In the construction script, drag off the plane, and make a dynamic material instance, save it in a variable.

Then apply those parameters to that material at runtime.

Thanks. I am bit confused here, but, by creating a new dynamic material, definitely UE is creating a new instance of the source_material and automatically applying to the target, I guess. When I first came to try this, my idea was that getting the material already applied and changing its parameters would be easier than creating a new material and setting it to target.

out of topic, but now I can only see the results in play mode. Is there any way of debugging it - changing the position of the cube and update the material parameters in edit mode? I have added a custom_event callable in editor, with a button to update the values. Is that the way to go?

1 Like

Looks good. It might work in editor, if you just move all that to the construction script.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.