In Kismet, the set scalar, vector, and texture param nodes allowed me to select a material instance from the content browser, set the param name, and set the value in order to do dynamic material functions, but now I don’t seem to be able to do that. UE4’s Set Vector (and scalar and texture) param has inputs for Material Instances, but won’t allow me to pick any in the content browser, and the materials don’t seem to be able to be referenced like other objects.
I’m sorry, that was an unclear question. I’m in blueprint, and I have the whole function setup and ready to play, but the Set Vector Param Value node doesn’t allow me to choose a material instance from my content browser. It has the slots available for me to put something in, but for some reason, my material instance isn’t an acceptable option.
There is an easier way to do that for scalar and vector values. You can define Collection Parameters inside the material for the scalar value you want to change, then create a Material Parameter Collection in the content browser and set is in parameter collection node inside the material. Select the collection you created in the content browser and then use that parameter collection to set any value in the BP.(the parameter collection in the content browser should update as you compile your material.)
Hi Navillus,
Have you tried the blueprint? Now you’ll need to do this in blueprint editor, by using the level blueprint or create a blueprint just for your material.
In your case you can use the Set Vector Param Value and to use a Material you need to transform it in a Dynamic Material Instance inside the constructionScript in your BluePrint.
there is a difference between a material instance and a vector UE4 treats them as different type. What you are looking for is Create Dynamic Material Instance
You need to transform your material instance inside your ConstructionScript.To do that use a Create Dynamic Material Instance,create a variable Material Instance.Set it with the Set Material node ( create a variable to your mesh for target slot) and link the variable Material Instance to slot Material.
Now get out of constructionScript and go to EventGraph,inside it you can take your Material Instance variable and link it in the Set Scalar Parameter Value ( target slot).
Hope it helps.
This is creating a material instance and changing variables inside the material. In this example they are applied to a particle in a blueprint but can be used anywhere
First I create a variable or type Material Instance Dynamic to hold my material instance for reference later
after that I spawn the selected material using Create material instance dynamic. This takes in a material from the content browser. After spawning it I need to setup my emitter and then apply my material.
After that I use set Scalar Parameter value to change the value of the variable in the material.
If this helps anyone, I’d appreciate an up vote
Thanks. Just what I was looking for.
(Pay attention that you need a material instance dynamic)
If anyone stumbles across this, go check this thread, as something is quite shady about the usage of Dynamic Material Instances!
As you’ll be able to see, you can do this without any Dynamic Material Instance (MID), which is VERY strange, since the documentation clearly states it cannot be done…