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]