So there are lots of squares (about 200-300) in my scene. They are moving a little, and they need not to cover each other. It's pretty hard for a computer to add Rigidbody2D
to them. I tried to add BoxCollider2D
and Mesh Colliders
on each object and code OnCollisionEnter2D
in the script, but it just doesn't work. Convex MeshColliders
don't work (at 2D, I suppose. why?). So how can I deal with it without using Rigidbody
? Is it a wrong way to use Collider2D
?
EDIT:
First of all, I'm sorry for my bad english.
Secondary I want to thank all of you for your answers. These are great references and I'll spend much time to go deeper in that. I've found the answer, it's quadtree. There's a good example/tutorial in this page