Description

BoxCollison's OnComponentHit event is not triggered when BoxCollison hits a spawned actor with simulate physics enabled. The event is triggered if the same actor has been placed in the level beforehand. 

 

Workaround Code in UE5.1

PhysScene_Chaos.cpp
FPhysScene_Chaos::HandleCollisionEvents(const Chaos::FCollisionEventData& Event) 

// Get swapped velocity deltas
const FVector& DeltaVelocity1 = bSwapOrder ? CollisionDataItem.DeltaVelocity2 : CollisionDataItem.DeltaVelocity1;

const FVector& DeltaVelocity2 = bSwapOrder ? CollisionDataItem.DeltaVelocity1 : CollisionDataItem.DeltaVelocity2;

NotifyInfo.Info0.SetFrom(GetBodyInstanceFromProxyAndShape(PhysicsProxy0, bSwapOrder ? CollisionDataItem.ShapeIndex2 : CollisionDataItem.ShapeIndex1), DeltaVelocity1);

NotifyInfo.Info1.SetFrom(GetBodyInstanceFromProxyAndShape(PhysicsProxy1, bSwapOrder ? CollisionDataItem.ShapeIndex1 : CollisionDataItem.ShapeIndex2), DeltaVelocity2);

 

 

Steps to Reproduce

1. Open attached project.

2. The vehicle moves forward and collides with a "Spawned" Box.

    Both box and car detected OnComponentHit event and logged.

3. The vehicle moves forward and collides with a "Placed" Box.
    The box detects OnComponentHit event and logs, but the car does not detect the OnComponentHit.

 

Have Comments or More Details?

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

4
Login to Vote

Unresolved
ComponentUE - Simulation - Physics
Affects Versions5.1
Target Fix5.6
CreatedFeb 20, 2023
UpdatedOct 25, 2024
View Jira Issue