0

I've been stuck forever in trying to extract parametervalues from the materials which are hit by my ray from RayCast. I've been mainly focused on gaining a material sample of the Actor hit, following something like this structure:

FHitResult& HitInfo;
UMaterial* Material;
float specular;

Material = HitInfo.Actor->GetComponents<UStaticMeshComponent>()->StaticMeshComponent->GetMaterial(x)->GetMaterial();

specular = Material->Specular.Constant;

My expectations were to recieve a float between 0 and 1. But first of all i had to edit the meta data for the compiler to find the member: Constant. Thereafter I managed to obtain a value but it seems to be the standard value given in \Engine\Source\Runtime\Engine\Private\Materials\Material.cpp .

Does anyone know if Im on the right path here?

Thanks!

0 Answers0