Unreal Engine 5 OnChaosBreakEvent not working

129 Views Asked by At

enter image description here

I am trying to break objects with Unreal Engine's Chaos destruction. I want to remove objects after a small delay after the object has broken. I'm trying to do this with On Chaos Break Event in blueprint but it doesn't work. Seems like it doesn't even notice the object has broken (I don't even get a print text). Does anyone know what to do?

I have tried to use also other chaos events and also searching the whole internet but it seems like there is no information about this events and Unreal's documentation is horrible.

2

There are 2 best solutions below

0
Neil Mendoza On

To get this to work in C++. I had to call SetNotifyBreaks first and I also had to do it in BeginPlay() as would give me an error if I tried to attach the delegate later in the game...

GeometryCollectionComponent->SetNotifyBreaks(true);
GeoComponent->OnChaosBreakEvent.AddDynamic(this, &AWallActor::OnGeoBreak);  

In a Blueprint, I'd check that the correct events notifications are enabled on the GeometryCollectionComponent.

0
JeckleCed On

Yes, as mentioned, you need to have the Notify Breaks flag set to true to allow the reception of break event in geometry collections

Also please note that there's a Remove On Break built in feature since version 5.1 ( you can search for Remove On Break in the release notes : https://docs.unrealengine.com/5.1/en-US/unreal-engine-5.1-release-notes/ )

This allows to set how fast pieces disappear after they broke off and you can se those parameters on a per-piece basis ( using the corresponding tool in the fracture editor )