How can I create a DynamicMaterialInstance of a material instance in UE4, and set it on a material billboard?
I’ve tried every combination I can think of, all I want to do is have an en-editable material billboard with a dynamic material instance on it, and set some of the scalar parameter values. Ideally, I want to be able to use a static material instance too as opposed to a variable, so I figure I can do this using the ConstructorHelpers library?
I need to be able to access that material instance anywhere in the corresponding class, to set values in it.
It looks like as of 4.8 P1 this issue has been addressed to expose Material Billboards to the same control as you would expect in a blueprint. I have attached a very simple test map, if I am missing a functionality you are wanting please let me know -
Unfortunately Cobyris’ method didn’t work for me. I had to do another workaround, eventually got it working but it wasn’t very smooth. I had to create the dynamic material first then set it on the Billboard.
I still don’t think it allows runtime changes though.
I am confused my test project shows a setup in which a MID is created from a MIC and assigned in the Construction Script, then in the event graph a Scalar and Vector Parameter are changed on “K” Pressed events. What exactly are you trying to call in Blueprints that you still cannot?
I did this in blueprint originally, and to make it work I got the material info from Elements then clear elements and used AddElement with a new dynamic material. I believe it worked, but that was a while ago.