Hi, i didn’t planned to use physics in my game at all, but I tried with one object shattering effect and it’s look pretty nice! But effect would be even better, if this objects properly collides with everything else. So im wondering, if I add Mesh Colliders to all objects, but rigidbody ONLY for shattering elements, it would cause big performance loss? Especially on mobile? First tests on my device are promising. Also profiler don’t goes for big, worryfing numbers.
Also what if I don’t have even one element with rigidbody on scene? Will the Mesh Colliders do something or they will be transparent?
Collision detection (MeshCollider) and dynamics simulation (Rigidbody) are two completely separate, independent matters.
If you are using MeshColliders, you’re paying their cost whenever an object using a MeshCollider collides against another object (regardless of rigidbodies being present in either object), and possibly even when they’re just near each other.
Keep in mind that moving non-rigidbody objects by directly setting their transform will cause them to ignore collisions. If other objects in their way are rigidbodies, they will be very prone to tunneling (that is, missed collisions), specially if they’re small and move fast. If you’re going to move objects around, it’s best for them to be kinematic rigidbodies and use MovePosition.
If no objects in your scene move at all, then MeshColliders have no impact on performance (but they’ll still consume memory to store collision geometry).