Internal Error: Too many pairs created, new pairs will be ignored. This is perhaps due to an excessive number of objects created at one location.:

Hi all!
I’m creating a cube world. While it works with 50x50x3, with 100x100x3 (30000) elements i get the error:

Internal Error: Too many pairs created, new pairs will be ignored. This is perhaps due to an excessive number of objects created at one location.:

I see this discussion:

but some resolved ( i splitted 1001003 in 4 sub-matrices of 50503 but doesn’t work), one says it’s phisX limit. any suggestion?

Well, it’s a PhysX limit. When you do collision detection in a physics engine, typically you locate objects that can collide with each other. Since collision happens between two objects the physics system calls them pairs. All the objects in the scene and processed and pairs are created - these will be references to two objects that either are colliding or might be soon colliding.

In your case, I guess you have many many many objects all located at the same point in space, so they are all colliding with each other. PhysX has tried to create pairs and has simply run out of space to store the pairs.

The solution is to design your game so that PhysX does not have so much work to do. Do you actually need collision detection between 3000 cubes? If the cubes are all aligned in a grid you could detect the collisions with some simple maths and not use PhysX.

The link you posted in your question pretty much says what I just said.

I was able to make the error go away by changing the center point and size of the collider. My small cube prefab objects are 1x1x1 and I set the origin to .5,.5,.5 and the scale to .45 in each direction. No longer get the error but I still can’t seem to create cubes larger than 25 in scale. That’s 25 squared of smaller cubes so I know it’s a lot but I am trying to figure out how to make large terrains, just like you.