How to deal with *many* moving colliders?

I have a lot of colliders in my game. And they all move. The main object (the player) is a Rigid Body with isKinematic checked. None of the other objects have a Rigid Body, just a collider (atm a Mesh collider but I’m considering punting and using basics).

Everything is a Trigger.

ALL GameObjects that are colliders (excluding the player) are contained in another empty GameObject so I can transform their locations based on a grid system. Meaning, I do not manually move each Collider itself, I just move its empty parent GameObject.

And due to me moving everything, I do not use any physics in my game.

I have read many conflicting sources that say either:

  • Many RigidBody’s produce heavy
    performance load

or

  • Many moving objects with collision
    should have a RigidBody with
    isKinematic checked.

I am currently having iOS performance issues and I need to see if I can squeeze as much out of my code as possible.

  1. Can I turn off Physics completely?
    Or at least enough such that only
    Trigger collision detection is
    performed?
  2. Should I keep all collider’s as basic colliders or
    should I put RigidBody’s on them
    with isKinematic enabled?
  3. All colliders fall within 1 of 8 or so basic mesh’s (think circle, oval, triangle, hexagon, 4-point star etc) with as few triangles as possible. I currently have “mesh collider” on each of them so that that specific shape is used for collision. Since I have as few triangles as possible, is this ok? Or should I actually just punt and use one of the 3 built-in primitive colliders (Box, Sphere or Capsule)?

Thanks so much!

PAR

  1. No, you cannot turn off unity’s Physics engine, but you -can- utilize it more carefully. OnTriggerEnter, OnCollisionEnter, etc. are only called if they are contained within a behaviour that is attached to a game-object with the proper collider/rigidbody arrangement for that method call, so as long as you only use trigger-colliders (colliders with “isTrigger” checked), you should be good.

  2. isKinematic disables all physics effects on the rigidbody, but allows it to affect other rigidbodies. If you want to know whether an object will get a collision call, simply check the corresponding documentation page. Box Collider, sphere collider, capsule collider, mesh collider, and wheel collider are the only ones available, in unity. If there’s no physics involved with a given collider, and it’s just a trigger, I’d suggest just not using rigidbodies, and sticking to the trigger collider. Otherwise, depending on how complex the physics will be, you may or may not want to use an attached rigidbody.

  3. Mesh colliders will not collide with other mesh colliders, unless at least one of them is set as convex. However, mesh colliders -will- collide with other colliders that are -not- mesh colliders, with or without being set to convex. However, stick to built in colliders whenever possible. It will likely improve efficiency by quite a bit, as the system knows exactly what the mesh looks like, and is optimized to use it.