Hierarchical Instanced StaticMesh crashes adding instance

During AddInstance() my game crashes. It’s crashing at strange locations in a loop. For instance it’ll crash at instance number 23 during certain configurations, yet it’ll crash at other iterations for others. All that is provided is a transform when calling addinstance. This leads me to believe that there is something odd going on. How could it successfully add instances and then within the same loop, fail? When it does crash the below is within the BodyInstance.cpp and this is the if statement it brings me to

This appears to be the if statement last called

if (InAggregate->getScene() == nullptr || InAggregate->getScene() == PDyanmicScene)
				for (PxActor* Actor : PDynamicActors)

I found this post but it doesn’t appear there is a consistent solution. Nothing described here worked for me, and it sounds like it didn’t really work for everyone on it.


I just noticed the exception thrown. It says this:

this->mConnectorArrayPool.mFreeElement was 0xFFFFFFFFFFFFFFFF.