UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a blue part"
// Create a blue material UMaterialInstanceDynamic* UMyBluePart::CreateBlueMaterial() { // Load the material UMaterial* BaseMaterial = LoadObject<UMaterial>(NULL, TEXT("/Game/Materials/MyBlueMaterial.MyBlueMaterial")); // Create a dynamic instance of the material UMaterialInstanceDynamic* BlueMaterial = UMaterialInstanceDynamic::Create(BaseMaterial, this); // Set the material's color parameter BlueMaterial->SetVectorParameterValue(TEXT("Color"), FLinearColor(0.0f, 0.0f, 1.0f)); // Return the dynamic material instance return BlueMaterial; }