Physics component dynamic removal/add cause chaos physics to crash

Hello, I’m not 100% on what the issue is, but this is where I most likely think the issue lies at this point.

I have a tether based on a bunch of a bunch of capsules attached with physical constraints created dynamically. the tether can merge, split and resize the capsules to minimize the resolution without minimizing quality. Anyways, it seems to me that when we destroy components (usually constraints), we get an array out of bounds error from UnbindEdgesFromNodes. Since I’m seeing Chaos, and the crash usually occurs at random while I’m moving the tether, I would guess there is some conflict or race condition in the physics thread.

I tried disabling the Merge and split functions, and well.. the crash is because of performance issues rather than chaos at least.. Can’t tell for sure if it means that the issue lies in the destruction/edit part, but it might indicate so since I got further than average.

I understood this to be that Chaos has marked the physical constraint for destruction, then I override/remove the reference from my tether array. If I do so, it probably creates a race condition whether chaos or garbage collection is getting to the component first. I tried to create a scheduler list so that I can postpone the destruction one tick to let Chaos complete the BreakConstraints() first, but the issue is still there.

I’m a bit lost what this could be. Does anyone have any experience with this? Left the first few lines of the Callstack here in case it helps.

[2025.10.03-14.18.03:795][177]LogWindows: Error: Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 783]
[2025.10.03-14.18.03:795][177]LogWindows: Error: Array index out of bounds: 5 into an array of size 5
[2025.10.03-14.18.03:795][177]LogWindows: Error:
[2025.10.03-14.18.03:795][177]LogWindows: Error:
[2025.10.03-14.18.03:795][177]LogWindows: Error: [Callstack] 0x00007ffacae84fc0 UnrealEditor-Chaos.dll!Chaos::Private::FPBDIslandManager::UnbindEdgeFromNodes() [D:\build++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Private\Chaos\Island\IslandManager.cpp:1171]
[2025.10.03-14.18.03:795][177]LogWindows: Error: [Callstack] 0x00007ffacae7b9f9 UnrealEditor-Chaos.dll!Chaos::Private::FPBDIslandManager::RemoveConstraint() [D:\build++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Private\Chaos\Island\IslandManager.cpp:897]
[2025.10.03-14.18.03:795][177]LogWindows: Error: [Callstack] 0x00007ffacb41ad7b UnrealEditor-Chaos.dll!Chaos::FJointConstraintPhysicsProxy::DestroyOnPhysicsThread() [D:\build++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Private\PhysicsProxy\JointConstraintProxy.cpp:178]
[2025.10.03-14.18.03:795][177]LogWindows: Error: [Callstack] 0x00007ffacb34dd1f UnrealEditor-Chaos.dll!UE::GeometryCollectionInternal::FGeometryCollectionProximitySpatial::TransformVertices'::2’::<lambda_1>::operator()() [D:\build++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Private\PBDRigidsSolver.cpp:1018]
[2025.10.03-14.18.03:795][177]LogWindows: Error: [Callstack] 0x00007ffacb37b80f UnrealEditor-Chaos.dll!Chaos::FPBDRigidsSolver::ProcessPushedData_Internal() [D:\build++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Private\PBDRigidsSolver.cpp:1894]
[2025.10.03-14.18.03:795][177]LogWindows: Error: [Callstack] 0x00007ffacae25f04 UnrealEditor-Chaos.dll!Chaos::FPhysicsSolverProcessPushDataTask::ProcessPushData() [D:\build++UE5\Sync\Engine\Source\Runtime\Experimental\Chaos\Private\Chaos\Framework\PhysicsSolverBase.cpp:116]
[2025.10.03-14.18.03:795][177]LogWindows: Error: [Callstack] 0x00007ffacae13f71 UnrealEditor-Chaos.dll!TGraphTask<Chaos::FPhysicsSolverProcessPushDataTask>::ExecuteTask() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:634]
[2025.10.03-14.18.03:795][177]LogWindows: Error: [Callstack] 0x00007ffacae44400 UnrealEditor-Chaos.dll!UE::Tasks::Private::FTaskBase::TryExecuteTask() [D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Tasks\TaskPrivate.h:504]

Hey, I am checking your issue! Do you mind sharing your exactly Engine version?
I found a line mismatch while checking the assertion on 5.6.1:

Hey, thank you for having a look! I’m using 5.5.4.

Looks like the issue lies with my naming system.

Using MakeUniqueObjectName(this, StaticClass, TEXT(<Some base name>), EUniqueObjectNameOptions::GloballyUnique) to generate the names somehow cause the crash. If I go back to using printf(TEXT(<Some base name>%d),i), it works again. However, this naming convention somehow crashes when I package my build. If memory serves, I think the issue was some kind of name conflict from having multiple of the same tether that generates the same component names… if I understood the true issue… That issue started happening once I added more levels that we could load into that has the same TetherActor.

Anyway, that’s why I originally switched to MakeUniqueObjectName to begin with, and I have to go for one of two solutions that each have an issue I don’t truly understand why is happening.

I have encountered this issue when creating breakable physics constraint components during runtime. The crash was likely occuring during GC (exiting PIE/destroying the actor). I tried many things, like destroying it manually before GC/after breaking, using constraint actors instead, setting limits to free manually instead of letting it break, etc… None of that helped.

The way I ended up solving this issue was creating a FConstraintInstance struct inside the custom component I was working on and managing the constraint through it. This let me implement the mechanic I needed without having to abandon it completely or avoid physics constraints. This is my first time posting on the forums, and I’m not 100% sure if this is the right place, but this was one of the most annoying bugs I had to deal with, and there was virtually no useful info online, so I wanted to leave this post in case anyone has a similar experience.