Description

There appears to be an issue with how raycasts are performed within PxScene. When performing the trace, only the collision response for the first ECollisionChannel seems to be considered. If all collision channels are set to ignore, then only the channel on which the trace is being performed is set to block, anything that should return a blocking hit on the trace will be ignored.

In the test project, a custom collision channel is being used (ECC_GameTraceChannel5, named "SpawnerTrace"), but I suspect the same results will be seen when tracing on any channel other than ECC_WorldStatic. Before the trace is performed, the collision response for all channels is set to ECR_Ignore, then the collision response for the channel the trace is being performed on is set to ECR_Block. When debugging I could see that this setting was applied appropriately to the collision response array. However, I could not debug beyond the call to PxScene::raycast (line 774 in PhysXCollision.cpp at CL 3774039).

While testing, I tried setting only the ECC_WorldStatic channel to ECR_Block, and this resulted in a blocking hit being detected along the trace even though the custom channel being used for the trace was still set to ECR_Ignore.

REGRESSION:
No. The same behavior was observed in 4.16.3.

Steps to Reproduce
  1. Download the attached test project (created in CL 3774039).
  2. Associate the project with your version of Main.
  3. Build the project in Visual Studio.
  4. Open the project in the Editor.
  5. Start simulating.

RESULT:
The message "Miss!" appears in the top left corner of the screen.

EXPECTED:
The message "Hit!" appears in the top left corner of the screen.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-52793 in the post.

3
Login to Vote

Won't Fix
ComponentUE - Simulation - Physics
Affects Versions4.16.34.17.24.19
CreatedNov 28, 2017
ResolvedAug 18, 2021
UpdatedAug 18, 2021
View Jira Issue