Description

When using Weld Simulated Bodies enabled AttachToComponent func, the child Primitive Component's BodyIstance ActorHandle is released. As a result, in BodyInstance.cpp, the judgment of FPhysicsCommand :: ExecuteWrite (ActorHandle, [&] (const FPhysicsActorHandle & Actor) is flipped , and because UpdatePhysicalMaterials does not work, SetPhysMaterialOverride does not function properly.

You should be able to fix this issue by modifying UpdatePhysicalMaterials as follows:

 

void FBodyInstance::UpdatePhysicalMaterials()
{
 SCOPE_CYCLE_COUNTER(STAT_UpdatePhysMats);
 UPhysicalMaterial* SimplePhysMat = GetSimplePhysicalMaterial();
 TArray<UPhysicalMaterial*> ComplexPhysMats = GetComplexPhysicalMaterials();
//FPhysicsCommand::ExecuteWrite(ActorHandle, [&](const FPhysicsActorHandle& Actor)
 FPhysicsCommand::ExecuteWrite(GetActorReferenceWithWelding(), [&](const FPhysicsActorHandle& Actor)
 {
 ApplyMaterialToInstanceShapes_AssumesLocked(SimplePhysMat, ComplexPhysMats);
 });
}

 

Steps to Reproduce
  1. Open SlipTest_4_21 in attached project
  2.  PIE

expect :The box slides in a few seconds

result : The box does NOT slide.

Have Comments or More Details?

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

2
Login to Vote

Fixed
ComponentUE - Simulation - Physics
Affects Versions4.224.21.2
Target Fix4.23
Fix Commit6544780
Main Commit6903163
CreatedMay 7, 2019
ResolvedMay 17, 2019
UpdatedJun 12, 2019