Download

Collision data isn't removed after clearing a section if bUseAsyncCooking=true

Clearing a section at runtime doesn’t remove collision if bUseAsyncCooking=true in Procedural Mesh Component(PMC). If I force IInterface_CollisionDataProvider::ContainsPhysicsTriMeshData to always return true, then collision will be removed but it throws a warning. I am looking for a solution other than using SetCollisionEnabled.

SetCollisionEnabled is the easiest solution for this, but I actually use RuntimeMeshComponent plugin to calculate mesh data on other thread and it is hard for him to access game thread things such as that function. A class called RuntimeMeshProvider do heavy mesh calculation on other thread using the plugin, and only he knows when the calculation is done and whether he has valid mesh or not. If it is not valid mesh, then IInterface_CollisionDataProvider::ContainsPhysicsTriMeshData returns false and it should work but no. As I said at first, if I force PMC/RMC to always return true for that interface, no collision but a warning. I have a lot of actors that hold the component and throw a ton of warnings so it is really annoying.

That is why I am looking for other solution. The only thing I came up with other than fixing the engine or giving up async cooking is that let actor set a timer to check if the class on other thread has a valid mesh or not and then if not disable collision from the actor. dirty.

By the way, I am not sure if (1) it is a bug of PMC and RMC just copied that, or (2) engine’s collision part issue. but no matter what, it is an engine bug. I already reported this and am waiting for it to be accepted. The Case number is 00390913.