This thread is pretty old now, but I wanted to chime in and just share a bit more information on it in case anybody is still stuck.
NanoVoxel suggests ticking “Generate Overlap Events” which does work, but not consistently, due to a quirk in the editor. So below are Adam Davis’ steps again, but with some more info afterwards to highlight this quirk and hopefully help with a workaround.
1. Create a new project with a third person character.
2. List item
3. Add a single line trace by channel after any event in character blueprint. Set this to draw a debug line from your player to the ground (I
chose 5000 units, to be safe).
4. Break the hit result and print the phys material to a string.
5. Compile, save, close blueprint
6. Create new physical material
7. Create new material (add whatever you want in it)
8. Apply material to landscape
9. List item
10. In the details pane after selecting the landscape, make sure to change “Default Phys Material” to your physical material.
11. PIE, run your trace.
My findings have been that after following these steps, the trace was still showing “DefaultPhysicalMaterial”.
I found if I then ticked “Generate Overlap Events” (thanks NanoVoxel!) under the Collision section of the Landscape’s Details browser and tried it again, the correct physical material would show from the line trace.
However - and I think this is where things get confusing - if I change the landscape’s physical material again and try it, the line trace will show whatever physical material was selected previously.
Well, it appears that it’s necessary to tick (or un-tick) “Generate Overlap Events” EACH TIME a change is made to the landscape’s physical material, or it won’t show which physical material is currently selected.
A little difficult to describe but hopefully you can make some sense of this. Basically, every time you wish to update the physical material on the landscape you must tick or untick “Generate Overlap Events” to get it to update and work correctly.
Hopefully somebody at Epic can repro this and identify if it’s a bug?
One other thing to highlight in Adam’s steps is this:
I did notice that physical materials directly tied to normal materials are not picked up, but this Default Phys Material located directly in the Landscape Details Pane does. Please try this and see if it works for you.
My findings were consistent with this. The only physical material the line trace could detect on the landscape was the one selected in ‘Default Phys Material’, it could not detect the physical material from its “Landscape Material” in the Details pane. This sounds like a bug too.