Collisions updating wierdly when updating procedural mesh, dynamic NAV mesh also not updating

There is a bug with UpdateMeshSection that I’m aware of that might be affecting you. If you have more than one vertex with the same position then it will be cleaned down to one of each position by the PxCooker when you use CreateMeshSection. Then when you call UpdateMeshSection, it tries to do a much faster way of updating the collision by just having PhysX rebuild the BVH. The problem here is you will not end up cleaning the mesh again so it will effectively apply the index buffer to the subset of vertices up to the length it was using… This will hold true if multiple sections within one PMC have vertices with duplicate positions. I’m not sure if the cleaning cycle within the PxCooker can rearrange vertices even if there’s no duplicates yet, as there are some other factors that affect it changing things around.

This results in all sorts of interesting collision problems… I submitted a fix for it a couple weeks ago by just forcing a full recook on Update. I’ll admit it’s not the best solution, but currently it’s the only solution since the PxCooker is hidden under multiple layers of editor cooking related scaffolding. It was closed since it would be slower even though currently it’s fully broken for non-trivial meshes.

I’m not sure about NavMeshes as I’ve never needed them yet.