Error: CDO Constructor: Failed to find Material

Ghar
Tue, 03 Feb 2015 21:11:00 +0000
Rendering

Hello, I’m trying to load a material instance from a blueprint:

static ConstructorHelpers::FObjectFinder<UMaterial> MIArea(TEXT("MaterialInstanceConstant'/Game/Materials/Decals/MI_area.MI_area'"));
if (MIArea.Object != NULL)
{
	UMaterial* TheMaterial = (UMaterial*)MIArea.Object;
	UMaterialInstanceDynamic* TheMaterial_Dyn = UMaterialInstanceDynamic::Create(TheMaterial, this);
	AttackAreaMesh->SetMaterial(0, TheMaterial_Dyn);
}

But I’m getting as a result: Error: CDO Constructor: Failed to find MaterialInstanceConstant’/Game/Materials/Decals/MI_area.MI_area

I right clicked the Material Instance in the Editor, then clicked “Copy Reference”, and pasted like in the code above.
The blueprint is in the right path.

What could be the problem?
Thanks

2 posts - 1 participant