Description

Wake/Sleep events are not generated for components set to generate wake events after having a component not set to generate wake events welded to them. Wake/Sleep events are also not dispatched for welded children whose welded parent does not match its attached parent.

 

The current workaround is to add a check in FBodyInterface::Weld as:

if (TheirBody->bGenerateWakeEvents)
{
    FPhysicsInterface::SetSendsSleepNotifies_AssumesLocked(Actor, true);
}

And to modify the check in UPrimitiveComponent::DispatchWakeEvents as:

if (BI->WeldParent == RootBI || BI->WeldParent == RootBI->WeldParent)
{
    PrimComp->DispatchWakeEvents(WakeEvent, BoneName);
}

This is a partial regression introduced in 4.21 from 4.20.

Steps to Reproduce

Create a BP from a static mesh actor, with an additional static mesh component as a child of the root, and place it in the level.

Set the root to simulate and generate wake events.

In the BP, change the component's material to be set based on the wake/sleep events.

PIE.

Notice that no wake/sleep events occur for the root.

 

Set the child component to generate wake events and PIE.

Notice that wake/sleep events now occur for the root.

 

Add an additional static mesh component as a child of the existing child. Set this grandchild component to also generate wake events and change material based on them. PIE.

Notice that no wake/sleep events occur for the grandchild.

 

Expected: Wake/Sleep events should still trigger regardless of welded children or hierarchy depth.

Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-85029 in the post.

1
Login to Vote

Unresolved
ComponentPhysics
Affects Versions4.214.224.234.24
Target Fix4.26
CreatedNov 25, 2019
UpdatedMar 3, 2020