Get PhysMat of Landscape material?

I have a reference of Landscape type in my BP. i want to get physical material out of it. i do not see any function retrieving it. i have set the Default Physical Material in the editor, as well as i did set physical materials for all my blend layers in the landscape material, but i just can’t extract the physical material in any way. thank you.

i see that a bug report for this exists since 2014 and is not being addressed: Multiple Landscape PhysMats? - World Creation - Unreal Engine Forums

You can raycast the landscape and get physical material at given point in hit result.

that’s not working on landscapes as my question indicates.

Did you get this working? I see lots of people asking and only a few answers. None of which work…

There is a posted bug, which Epic doesn’t treat for many versions already.
I have no workaround as for now sadly.

Hmm. strange and interesting. i don’t seem to know what’s foliage density. is it something only relevant to your particular case or landscape materials in general? doesn’t sound too logical to have a physmat assigned to a density (which seems like a float(?)). i ask that because i can’t check UE4 directly now. (burned GPU)

I found a solution. I’ve no idea if its correct, but it worked so… ¯_(ツ)_/¯

There was a layer on the landscape called foliage density, seemingly over the other layers, so preventing them from being detected. I turned the density down to 0 hoping to “get it out of the way”. That didn’t work… so I assigned the foliage density layer a physical material and… it all worked perfectly. For some reason. So I decided to turn the foliage density back up to whatever it was, 48% or something to see if it would still work. And it did.

So my conclusion is… you have to assign the foliage density a physical material. Just any random one. Then you can detect the materials underneath. Doesn’t make sense to me, but its working.

Surely that’s not how you do it, but hopefully it works for other peeps.

By the way, I have no knowledge of making landscapes, so I don’t know if “foliage density” is a default layer or did the guy put it in there himself - but hopefully you can adapt this to however yours is set up.

And everyone please holla if this works for you, as the only other solution I’ve seen is “Check the generate overlap events” box.

I have no idea! I’ve no experience with landscapes and textures, so I don’t know if its only relevant to my case or not. I can’t check now as I have finished the internship I was doing. It would be great if I had got a screenshot.

Hopefully some poor lost soul will happen upon this thread sometime and conclude the mystery.

I’m going to try make a landscape for myself later in the summer, maybe I’ll get some insight which will lead to a solid solution.