The question is mainly for 4.12, but if I understand correctly this has changed over time and I’d like to also make this work with earlier versions, at least to 4.10.
I’ve Google’d far and wide and have had no definitive answer on how to do material instances in C++. So far I’ve deduced that
static ConstructorHelpers::FObjectFinder<UMaterial> MatObj(TEXT("Path To Parent Material'")); UMaterialInstanceDynamic* DynMat = UMaterialInstanceDynamic::Create(MatObj.Object, this);
is supposed to be the way to go, but this causes the editor to crash - even without the class being in the level/viewport.
Do you know the trick?