Geometry Collection with Post Break Timer and Kinematic Particles

Hello,

We’re currently making a project with many props with a high level of destructability on UE 5.7.3. We’re using Geometry Collection and enabled “Tick Physics Async” in project settings.

We have some trouble getting the behavior we want with our prop’s Geometry Collections and we’d like some advice on how to proceed.

Our characters can shoot at the environment with weapons and partially destroy props, like tables or cupboards. But we want these elements fully gone after a few moments to prevent gameplay misdirection.

For that, we enabled “Remove On Break” and “Cluster Crumbling”, on our GCs and this is working well on a full “Dynamic” Geometry Collection and the usage of a field to break it.

Except we want to set some pieces of the GCs to kinematic to prevent the props flying around; and in that case, we noticed that the particles or clusters attached to kinematic pieces are never crumbling and stay visible in the scene even after the post-break timer elapses.

[Image Removed]

We tried to set all pieces to dynamic and explicitly apply external strain to break down the connections between the clusters, hoping the Post Break Timer would do the rest. For that, we tried approaches like getting the RBDSolver from the GCProxy, and try calling SetParticleAnchored_Internal(), FRigidClustering::BreakCluster(), FRigidClustering::ReleaseClusterParticles() or FRigidClustering::SetExternalStrain().

We boiled it down to:

```

GCComponent->RemoveAllAnchors(); // Put all Anchored/Kinematic pieces to dynamic

GCComponent->CrumbleActiveClusters(); // Crumble the top level clusters/particles

```

which seems to behave as we want.

1. This approach seems to be working if called the same frame as a field application, but I was wondering, in your opinion, if it was a valid approach to achieve our goal and if we don’t forget any consideration in the process ?

2. We tried to add a timer before calling these functions, and in that case, it doesn’t work anymore. We can see that the dynamic state is changing, but the Clusters do not crumble.

[Image Removed]Any idea on how we can crumble the whole GC, including kinematic particles, after a certain time ?

You can try out in the test case we provided. Here is the code snippet in DestructionZooFunctionLibrary::CrumbleAfterTimer:

```

FTimerHandle Handle;

WorldContextObject->GetWorld()->GetTimerManager().SetTimer(Handle, FTimerDelegate::CreateLambda([GeometryCollectionComponents]()

{

for (UGeometryCollectionComponent* GeometryCollectionComponent : GeometryCollectionComponents)

{

GeometryCollectionComponent->RemoveAllAnchors();

GeometryCollectionComponent->CrumbleActiveClusters();

}

}), Timer, false);

```

Thanks in advance,

Guillaume

[Attachment Removed]

Steps to Reproduce

  • Open GCDestruction.uproject
  • Open MapBase
  • Press PIE, aim to one of the top corner of the GC and Left Click to destroy it
  • Notice the kinematic pieces became Dynamic but the GC doesn’t full crumble despite the Post Break Timer elapse and the “DestructionZooFunctionLibrary::CrumbleAfterTimer” is called from the Level Blueprint
  • Go to the Level Blueprint, in the “Master Field Destruction”, set the “Timer” parameter to “0”
  • Press PIE, aim to one of the top corner of the GC and Left Click to destroy it
  • Notice that the kinematic pieces are now dynamic, the GC does full crumble and the Post Break logic work as intended
    [Attachment Removed]

Hey,

I’m adding a comment to re-open the case. I had a notification for a message on this issue, but I can’t see it in the thread. It was stating that there was some errors when opening the provided project.

I ask some of my collegues to open it using a vanilla UE 5.7.4 and it worked for all of them, so I’m a bit puzzled.

Can you send me the specific errors when opening the project so I can try to fix them for you to be able to open it on your side ?

Thanks in advance,

Guillaume

[Attachment Removed]

Hi Guillaume,

I’m not entirely sure what happened here - it looks to be loading correctly now.

I’ll ask the devs why the timer isn’t seemingly working and revert!

Best

Geoff

[Attachment Removed]

Hi Guillaume,

I have a quick update for you - from what I’ve been able to tell, I think that the timer is being set and run on a stale handle.

I’m digging around a bit to check into what the normal use case is for this kind of situation, and will update

Bes

Geoff

[Attachment Removed]

Hi Guillaume, I’ve been looking into this and it is a strange one. If the field is moved else where (ie so it doesn’t interact with the GC) the delayed version works fine, so the combination of delay plus breakage is the thing which causes the bug. What is strange is that the logic doesn’t seem incorrect - the management class doesn’t change the reference. I’m chasing through the code some more to see why it actually does diverge and will add back when I have.

Best

Geoff

[Attachment Removed]

Hey Geoff,

That’s a weird one indeed. Glad to know my logic isn’t incorrect; that setup would help us to get more control on the GC and destruction on our project.

Looking forward to your answer if you find anything and good luck !

Best

Guillaume

[Attachment Removed]

Hi Guillaume,

5.8 actually contains the fix for this issue. There was a CL 54203002 submitted which fixed this up!

Best

Geoff

[Attachment Removed]

Hey Geoff,

I just tested my repro scene on vanilla 5.8 and this is working as intended !

That’s a good news because we’re in the process of upgrading our project to 5.8 very soon.

Thanks !

Guillaume

[Attachment Removed]

Great stuff and glad to hear it Guillaume!

I’ll get this closed off for now then. Let us know if you run into any other issues :slight_smile:

Geoff

[Attachment Removed]