I am making a first person shooter for PC and possibly web player, with a lot of objects in the scene at one time.
I am using sphere/box/capsule colliders for the physical collision detection as I have read that they are faster than mesh colliders. But for detecting bullet hits (raycast and rigidbody) this won’t be precise enough, and really I need the precision of a mesh collider. I am thinking of putting mesh colliders on everything that is meant to be hit by bullets, and putting these colliders on a seperate layer that only collides with projectiles.
Will this have a large affect on performance? I know mesh colliders are slow but surely if it is only colliding with one layer the physics engine will have a lot less to do each frame? Also, as a lot of these mesh colliders will be on rigidbodies, will that make a difference?
So, please could someone answer these three questions:
How much will a lot of mesh colliders affect performance?
Will putting the mesh colliders on a layer colliding with only one layer (or even no layers, as I could easily make the projectile weapons use raycast instead) improve their performance?
Does it matter if a mesh collider is on a rigidbody?