So I am using this code for applying set Scalar Value, The value is working right but is not applying
This is on the begin play:
BarrelMaterial = GetMesh()->GetMaterials()[0];
BarrelMaterialInstance = UMaterialInstanceDynamic::Create(BarrelMaterial, this);
GetMesh()->SetMaterial(0, BarrelMaterialInstance);
This is on the Tick function:
CurrentAlphaBarrelOpacity = FInterpFunction(GetWorld()->DeltaTimeSeconds, CurrentAlphaBarrelOpacity, 0.0f, SpeedToVanishBarrel);
BarrelMaterialInstance->SetScalarParameterValue(“Alpha”, CurrentAlphaBarrelOpacity);
UE_LOG(LogTemp, Warning, TEXT(“Show Alpha %f”), CurrentAlphaBarrelOpacity);
the LogTemp, Alpha is giving 0 so is Right, and when I pause the game the Dynamic Material is applying right, so I can open the Dynamic material on the engine and change the Scalar parameter Value without problem to do the fade, the name Alpha is spelled right too.