Hi, I want to have a MaterialInstance-TArray in my Gamemode together with a “GetMaterialArray()” function for other to use those materials.
In the MyGameMode.h I have:
TArray<UMaterialInstanceDynamic> MaterialListArray;
void MaterialList(TArray<UMaterialInstanceDynamic>& Materials);
and in the cpp I tried:
void MyGameMode::MaterialList(TArray<UMaterial>& Materials)
{
Materials.Empty();
Materials.Append(MaterialListArray);
}
But I get the error message that it’s not allowed to get access to private members of UMaterial
I also tried Materials.Append(MaterialListArray.GetData()); but that isn’t working either. Unfortunately Google didn’t really help, so I’m trying my luck here - thanks for the help