Colliders ignoring each other on iOS?

I’ve developed a project where the user is able to zoom out using the multitouch display, but when i try to limit the zoom using colliders, they ignore eachoter and the camrea caontinues zooming out even through the collider.

what can i do to fix that?

Any help is appreciated

Colliders ignoring each other is almost always a case of moving your objects outside of the physics system. If you want colliders to respond to collisions, the moving collider must either have a rigidbody or a Character controller attached and you must move it using their functions.

Character Controllers:

  • Move()
  • SimpleMove()

Rigidbody:

  • AddForce()
  • AddExplosionForce()
  • rigidbody.velocity;
  • rigidbody.position
  • MovePosition()
  • AddRelativeForce
  • or any forces applied by joints will work too.

The important thing to note is moving an object by directly modifying its Transform will not involve the Physics engine and your colliders will pass through each other.