PCG's World Ray Hit Query doesn't work with physical materials in UE5.4

Basically the title. Using the PCG World Ray Hit Query to sample physical materials from a landscape AutoMaterial that uses the physical material output node doesn’t work in 5.4. I have the same level in 5.3 as well and it works correctly. I have the physical material layers debugging accurately on both engine versions, however in 5.4, it appears only one physical material is read and the entire PCG volume is treated as that one material, even though they’re not. The layers respond accurately to my debug raycast but they don’t work with World Ray Hit Query. Debugging options also changed in 5.4 and they’re totally greyed out and I can’t seem to find a way to get them to work. (and of course its all new so there’s little info to be found about it)

Trace channel is not the issue, Simple collision is not the issue. Its not about rebuilding Physical Materials or anything like that.The physical materials debug properly and the assets load properly.

For the record, I’m not a beginner and I don’t believe I’m missing something obvious or simple. I’ve tried extensively to troubleshoot or research this, but all signs point to it being a 5.4 bug since the same exact level and PCG and everything work perfectly in 5.3

I tried to report this with the ‘report a bug’ system, but I’m not sure it even worked. I just got an indefinite loading screen when I tried to submit it, so I’m posting here in hopes others are using these features and dealing with these issues. Any help or info would be much appreciated.

I am a beginner in PCG so forgive me if I’m not helpful but I did get this working in 5.4

The differences I can observe from yours to mine is I use soft object path in the attribute filter and direct it straight to the physical material asset rather than using strings
example

I also discovered in the World Ray Hit Query Node that there’s a toggle to get physical materials to work at all. PCG seems to have changed a lot with each version(and I only started with 5.4) so I’m not 100% sure if this is new or not but for anyone else reading this trying to troubleshoot make sure that’s checked

1 Like

I also was able to get JellyMesh’s solution to work using the world hit check box for physical materials and then a soft object reference in the filter instead of the substring. I actually like this layout better as dropping the material in directly like that prevents the possibility of any spelling errors and makes changing them out much more straight forward.

Another nice bonus for using the world hit like this is that if you combine it with a water body distinguishing between your water body and landscape happens at the physical material filter level so you don’t need to do anything special.

I imagine this soft path thing might also be useful if you’ve got something in your landscape like a big static mesh. I bet you can use it to do something with that.

1 Like