0

I have a texture material that changes between 2 textures. This change can be controller by a variable. I've made a material instance from this material as well as a blueprint that has an object in it, to which this MI texture is applied to. I was hoping to update the materials variable parameters through the blueprints event tick but I am having difficulties figuring out how to access this parameter.

Would anyone know what has to be done in blueprint to access parameters and change them?

Artyu
  • 19
  • 1
  • 2
  • 7

2 Answers2

1

Materials can be accessed in Blueprint by creating a Material Instance and then storing a reference into a variable (if you plan to use it int eh future).

Once you create a Material and define a parameter by giving it a name, create a Material Instance based on that Base Material. This is an asset that allows for quick updates by caching part of the underlying pipeline.

Once you've done so, you'll need to use a CreateDynamicMaterialInstance, store the ootput, set it in the corresponding material slot for the Mesh and then use the SetParameter nodes (Vector, Scalar, etc.).

Once you've done that, you're good to go.

You can also get an Instance from a slot directly if the Base Material is not going to change.

Fritz
  • 9,987
  • 4
  • 30
  • 49
0

Materials can be accessed in Blueprint by creating a Material Instance and then storing a reference into a variable (if you plan to use it int eh future).

I think it should added, that within a BP, a Material is accessed first by the Get Material node, then iterate each returned Material using For Each Loop. For each element, Create Dynamic Material Instance.

lernie
  • 21
  • 2