Incorrect Physical Material being returned in hit result

Engine Version: 4.9.1

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.

Hello ,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

  1. Can you reproduce this issue in a clean project?
  2. If so, could you provide a detailed list of steps to reproduce this issue on our end?
  3. Could you provide screen shots of any blueprints that may be involved with this issue?

1: Yes, I verified that it happens in a clean project. I created a first person shooter template and replicated the issue.

  1. Create a static mesh object which
    has at least two different material
    slots you can assign to it.
  2. Assign two different materials to the static mesh object (element 0, element 1)
  3. For each material, assign it a different physical material
  4. 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

I have to upload screenshots in multiple comments due to size limitations… bear with me here.

Here is a static mesh (building) with materials assigned to multiple elements

The wood material has a PM_Wood physical material applied to it

The stone material has a PM_Stone physical material applied to it

Just for reference, I created three different physical materials. I just gave them a unique name, changed nothing else. They’re exactly the same.

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.

Hello ,

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.

Make it a great day

1 Like

Yep, that did the trick. Thank you!

I thought that complex collision is more expensive than simple collision so how can I get good performance using 2 physical materials?