I'm new to unreal coding, I want to apply texture to material, but I'm stuck with creating:
UMaterialInterface* Material = CreateDefaultSubobject<UMaterial>(TEXT("MyMaterial"));
UMaterialInstanceDynamic* DynamicMatierial = UMaterialInstanceDynamic::Create(Material, this);
I've got this error message:
NewObject with empty name can't be used to create default subobjects (inside of UObject derived class constructor) as it produces inconsistent object names. Use ObjectInitializer.CreateDefaultSuobject<> instead.
This error comes from second line. Any idea why this error occurs? Or is there any other easy way to apply texture to material?
After 4 days of searching I've found correct answer to my texture problem in this post: