I’ve got a static mesh of a building which contains 9 material elements. When I run a “LineTraceByChannel” node against a surface, the hit result always contains the physical material for Element 0 instead of the physical material at the hit position.
1: Yes, I verified that it happens in a clean project. I created a first person shooter template and replicated the issue.
Create a static mesh object which
has at least two different material
slots you can assign to it.
Assign two different materials to the static mesh object (element 0, element 1)
For each material, assign it a different physical material
Create something which will run a line trace against the static mesh and retrieve the physical material you assigned to the particular portion of the static mesh. In my case, I created a line trace to occur at the FPS actor foot position
As you can see from the print string output, the characters steps are clearly stepping on the stone material but the output is hitting the wood material. This is because the physical material ‘wood’ is assigned to element 0 in the list of materials.
Could you try turning on trace complex for the line trace that you are using? This should allow you to read the physical material that is applied. I hope that this information helps.