Description

There are inconsistencies with how the inherited body + bodies of a skeletal mesh are treated across the various inherited/overridden primitive component functions, and their multi-body forms.

For instance:

  • SetCollisionObjectType and SetAllBodiesCollisionObjectType are the same, setting bodies and the inherited body.
  • SetSimulatePhysics sets bodies(using the physics asset type) and the inherited body, while SetAllBodiesSimulatePhysics explicitly does not set the the inherited body and overrides bodies.
  • SetNotifyRigidBodyCollision does not set the inherited body, while SetAllBodiesNotifyRigidBodyCollision sets bodies and the inherited body, but is missing a call to OnComponentCollisionSettingsChanged.

 

UpdatePhysicsFilterData is also called redundantly as part of the SetNotifyRigidBodyCollision function family, once in SetInstanceNotifyRBCollision and once in OnComponentCollisionSettingsChanged.

 

BuildBodyFilterData also relies on the inherited body instance as well as its own body instance to actually report hits, so if either isn't set hits aren't reported as demonstrated by the repro.  Checking the inherited body for notifys should either be removed entirely or moved to the non bDisableSkelComponentOverride branch.

 

Steps to Reproduce

Place a skeletal mesh component with block all collision into the level, with a simulating cube above it.

Enable hit events in the detail panel for the skeletal mesh component and print a message on hit.

PIE

Expected the cube falls on the skeletal mesh component, generates a hit event, and prints a message.

Result the cube falls and no hit event is generated.

 

Repeat this, but disable hit events in the detail panel and call SetNotifyRigidBodyCollision(true) for the skeletal mesh component on begin play.

Result the cube falls and no hit event is generated.

 

Repeat this, but have hit events enabled in the detail panel as well as calling SetNotifyRigidBodyCollision on play.

Result the cube falls on the skeletal mesh component, generates a hit event, and prints a message.

Have Comments or More Details?

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

3
Login to Vote

Won't Fix
ComponentUE - Simulation - Physics
Affects Versions4.24
CreatedJan 30, 2020
ResolvedJul 19, 2022
UpdatedJul 19, 2022