Weird Error- Please help!!

Hey everyone

I am working on a fairly large project with Box2d and I have a large amount of objects. I have walls that have 4 visible traps on them and upwards of 150 walls.
Which is around 600 objects- plus numerous other objects.

I have looked around a bit and increased the number of objects from the 512 to 1024 in the b2Settings.as file and am still getting this weird error.

Note: When I only have 2 traps activated on each wall everything works fine.

The error I get is:

Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at Box2D.Collision::b2BroadPhase/CreateProxy()
   at Box2D.Collision.Shapes::b2Shape/CreateProxy()
   at Box2D.Dynamics::b2Body/CreateShape()
   at WallFactory/wallType7()
   at WallFactory()


I know that doesn't help many people much, but I'm hoping with the CreateProxy function in there it will help some of the advanced people narrow down the errors for me.

Thanks in advance!
A proxy is when two aabbs are near each other. So if you have lots of objects colliding in groups, you will get a lot of proxies. you could either change the maxProxies value in b2Settings, or find a way to make your objects be more spread out, or have less objects.
I have a feeling you are constructing all of the walls and then rotating / moving them after they are built. That will quickly crash Box2D - it much prefers building the shapes where they are meant to be used. Try not to use SetXForm (or whatever that function is called) on instantiation.

Just a guess!
Both good advice, but b2Pair is actually for pairs of overlaps. b2Proxy is one for one with your shapes.
Damnit, I did it again. I know the difference and yet this isn't the first time I've mentioned the wrong one. That's what I get for posting while working I guess.

Original thread: https://box2d.org/forum/viewtopic.php?t=4955