Hello everyone,
The Situation:
My current project for the Meta Quest 3 involves a scenario where the user frequently changes one or more meshes in my scene. The game objects are supposed to remain interactive and therefore need a mesh collider.
The Problem:
My problem is that these changes to the mesh sometimes happen so frequently (multiple times per frame) that the frame rate takes a significant hit. This is due to the mesh collider adjusting to the new mesh.
The Workaround:
Currently, I’ve created a workaround where the mesh collider is disabled, and a box collider is enabled instead. This way, the performance no longer takes a hit, and the game object remains interactive. The only issues with this solution are that a) it makes interactions a lot less precise and b) it doesn’t allow interaction with smaller models inside a model. For example, there’s a box collider for a knight standing, and then there’s a box collider for his helmet. Taking off his helmet often leads to interacting with the knight instead, since the helmet’s box collider is inside the knight’s box collider.
My Question:
Is there a way to tell the mesh collider to stop updating itself or to stop interacting with collisions, other than using Layer Masks and the Collision Matrix? What other reasons could there be for the performance drop, and how could it be avoided?
I’m thankful for any advice and suggestions on how to improve this!