Hi,
I have a .fbx road, which have materials different for each part of the road.
I want to know the hit material name when using a line trace.
So I have this code:
this->GetWorld()->LineTraceSingleByObjectType(OutHit, VFStart_LR, VFLeft,FCollisionObjectQueryParams(FCollisionObjectQueryParams::AllObjects),CollisionParams);
if(OutHit.bBlockingHit){
UPhysicalMaterial* mat = OutHit.PhysMaterial.Get();
// Crash here...
FString str = mat->GetName();
UE_LOG(LogTemp, Log, TEXT("Hit Mat Name: %s"),*str);
}
The error message is:
CommonLinuxCrashHandler: Signal=11
[2018.05.15-13.37.47:132][110]LogLinux: === Critical error: ===
Unhandled Exception: SIGSEGV: invalid attempt to read memory at address 0x0000000000000000
So I think there is no name for the physMaterial, but there are names
So how can I get the correct material names?
Thanks a lot!
L