[4.7.1] UInstancedStaticMeshComponent::RemoveInstance very slow and spamming Physx error

I have an ISM component that has 1600 instances (40x40 grid), but when I attempt to remove an instance, the game pauses for a second and the logs are spammed with:

LogPhysics:Warning: PHYSX: …..\PhysXExtensions\src\ExtRigidBodyExt.cpp (234) 4 : computeMassAndInertia: Dynamic actor with illegal collision shapes

LogPhysics:Warning: PHYSX: …..\PhysXExtensions\src\ExtRigidBodyExt.cpp (283) 4 : PxRigidBodyExt::updateMassAndInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1)

The ISM has a in-engine generated collision box (simple box), and the physics simulation is disabled.

Any help is appreciated :slight_smile:

Note: I have tried my hand at using UHierarchicalInstancedStaticMeshComponents, but I’ve been met with other issues with them.

EDIT: Thanks to Jack P, I have moved to UHierarchicalInstancedStaticMeshComponents, so this no longer affects me.

Hey Grogger-

It appears that you were able to work past the problem you were having. I will be marking this post as resolved for tracking purposes as long as this issue has been resolved for you. If you are still having any troubles or experiencing any issues with Physx error spamming the logs, please feel free to reopen the post.

Cheers