- Home /
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: http://answers.unity3d.com/questions/43599/what-are-pairs.html
but some resolved ( i splitted 100*100*3 in 4 sub-matrices of 50*50*3 but doesn't work), one says it's phisX limit. any suggestion?
Answer by Graham-Dunnett · Dec 07, 2012 at 12:14 PM
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.
Yeah, all my cubes have got a collider. I need the collider because i have a no-rendered cube in front my camera and when it passes over the grid-cubes, renderizes only the cubes inside it. In this way i save fps and performace. Thanks you. I will try to scale the cubes-grid' collider from 1 to 0,5 so they can't collide, or try to use math =)
EDIT: If i set collider size to 0,5, it works and no more error =) it's a little bit slowly to create 30000 cubes, but maybe i can make some optimization in the creation process, paralleling first of all, but this is another problem ;)
THAN$$anonymous$$s a lot!
Answer by lunascii · Apr 24, 2013 at 04:04 AM
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.