I have a MaterialInstanceActor in my level referencing a material I’m using for my skybox.
When the level loads, I find the MI actor and replace the material instance constant (so I can make edits to it):
foreach AllActors(class'MaterialInstanceActor', matInstActor){
if (matInstActor != none && matInstActor.Tag == 'MaterialInstanceActor_SkyShpereStormClouds') {
//Create and set a new material instance so we can make changes through script.
StormCloudsMatInst = new(self) class'MaterialInstanceConstant';
StormCloudsMatInst.SetParent(matInstActor.MatInst);
matInstActor.MatInst = StormCloudsMatInst;
StormCloudsMatInst = matInstActor.MatInst;
break;
}
}
The problem is that making changes to StormCloudsMatInst doesn’t update the material displaying in game.
If I don’t replace the material, then I can make edits to the material, but then I get errors:
Are MaterialInstanceActors only supposed to work with matinee or something?