LineTraceComponent on ProceduralMeshComponent returning incorrect HitLocation

Doing a LineTraceComponent on a ProceduralMeshComponent returns a HitLocation on the far side of a box ProceduralMeshComponent for 1/2 the faces, if the far face on the line trace. A debug line from start to hit will go through near faces on register a hit on the far face.

To Reproduce:

Make an actor with a procedural mesh component. Then on BeginPlay generate a box mesh using GenerateBoxMesh then use the data as input to ProceduralMesh.CreateMeshSection to create a mesh, make sure to turn Create collision on.

Then try doing LineTraceComponent through both the near and far faces, i.e.

Hi mdomrach,

Unfortunately I have not been able to reproduce this on my end using the steps provided.

  • Does this occur in a clean, blank project with no additional content or is it limited to one project?
  • What steps can I take to reproduce this on my end?

Thanks for getting back so soon.

Does this occur in a clean, blank project with no additional content or is it limited to one project?

Yes, I reproduced this issue in a clean, blank project. The issue was occurring in a project that was on version 4.12.5 so I upgrade to the latest version 4.13.0 and made a new project to reproduce this problem.

What steps can I take to reproduce this on my end?

I have uploaded the project where I reproduced this issue togithub.com/mdomrach/MyProject

The project is setup so if you click the screen it does a line trace and draws a debug line with the results. To repo, I line trace the cube straight on so that line hits the face and the face opposite then repeat for the opposite side, as shown in the first picture. Then pause and hide ProceduralBP to show the debug lines and get the results shown in the second picture.

Hi mdomrach,

I am not seeing the same error you are describing. When I fire the line trace it seems to go to the point that I fired to without any error. Do you have any additional steps I can take to recreate this on my end? Are you rotating the camera to a different angle when you fire the second line trace?

I’ve updated the projectgithub.com/mdomrach/MyProject to automatically reproduce the bug. It line traces after a second and the cube is now transparent so the debug line results can be seen right away.

I also successfully reproduced the bug on a second device to make sure it wasn’t isolated to my computer (using the updated project).

The line trace must be fired so it goes through a face and the opposite face. A trace from one side returns a hit location on the opposite (far) face. A trace from other side behaves normally and returns a hit location in the correct location (near face). This appears to happen for all the pairs of faces on a cube.

Hi mdomrach,

I was able to reproduce the error with the provided project and have entered a bug report here. You can track the report’s status as the issue is reviewed by our development staff.