Hi all,
I dont know what is wrong here… maybe i found also some bugs?
I cant successfully change the “color” parameter of the dynamic material.
All this happen in the same actor,
tha actor have several meshes called , WAT_1… 2…3.
So i create an instance of dynamic material , and save his reference in an array,
then using the direct pin or the new made reference in the array i can set his parameter color to any color.
This work .
In another part of my actor, once i get the event, i want access the material of WAT_1.
And change again his color.
I cant change the color parameter , using the reference to the material stored in the array.
Neither i can access the material using the node "get material "of WAT_1
Plus , with my full surprise i found i can pin in the Whole array of reference to materials.
I am sure that the event fire because i get the print event.
Am i missing Something? I am really lost.
Maybe the color parameter get changed but not showed in the game?
I cant reproduce these strange events in a clean blank Project.
The only thing i can reproduce is this.
Just make an actor blueprint with a cube.
Create a material with a parameter as color.
At begin play create a instance of the material.
Set the input enabled for the character and add a keyboard event.
I can store his reference in an array or variable . i will work.
I cant access the material using the get material .
The node set vector parameter reject the pin.
I have a number of similar Mesh, so i create 10 instance dynamic of mymaterial, and just adjust the vector parameter “color” to make the meshes different.
I was sure that i was able to change
his color , just getting the material
reference , using the"" get material""
node on the mesh . and pin it to “Set
vector parameter” But this dont work , and i really dont get why. << ?
But for now i added a array in the event begin and in it i store all the new instanced reference of the materials.
With this array i can use the “Set vector parameter”.
the way to do this is to set a material instance dynamic within the construction script of your actor to the material you want to change. Following the steps in the link provided, you should be able to expose any parameter you set within the material to be alterable, all you’ll have to do is set the parameter value afterwards. Please let me know if this doesn’t work for what you are attempting to do.