Landscape physical material always nullptr

Im trying to play a different sound for each physical material.

I already added the surface types, crerated the physical material, and set the surface type on the physical material.

I set the physical material to the material, and set the material to the landscape

But when i trace, the landscape object has the physical material nullptr

alt text

If i do the same code, but on blueprint, it works, idk why, i want to make it work on c++

Ok, after some hours diving deep into C++ code i found

FCollisionQueryParams CollisionQueryParams = FCollisionQueryParams::DefaultQueryParam;
CollisionQueryParams.bReturnPhysicalMaterial = true;

Just need to set bReturnPhysicalMaterial to TRUE.

If we have a documentation explaining it, it would have saved more than 3 hours for me.

3 Likes