hello,
i’ve been searching through the documentation but i still cant figure out how to use the function UMaterial::GetParameterValue(). I dont understand its parameters quite well and ive tested different things, for instance :
FMaterialParameterMetadata OutParameterMeta;
HitMaterialInterface->GetParameterValue(EMaterialParameterType::Scalar, FMaterialParameterInfo(FName(“Roughness”)), OutParameterMeta);
UE_LOG(LogTemp, Warning, TEXT(“roughness %f” ),OutParameterMeta.Value.AsScalar());
My goal is to cast a ray to an object and getting its material in order to get the parameters of this material like its base color, metallic, roughness
i’ve tried using GetScalarParameterValue() before too but it didnt work for me either (i constantly get 0 as values even though its a material i created myself and defined its roughness to something different to 0)
So if anyone could tell me some direction on how to use those functions or anything else, even another way to get what i want, that would be of great help. Even small information would be nice, im quite desesperate here.