Closed jamessimo closed 10 years ago
SO Found the problem. Its BOX2D
Box2D creates a lock when inside a collision, so when I tired to create my car (which is also a box2d object), Box2d failes to create anything and iioEngine gets NULL.
That was quite the tricky customer. The solution is to put the create car call into a setTimeout
Hey guys, when call my function createCar inside of a box2d collision handler the engine returns the error
This function works every where else in my code but when I try to call it it from the Box2D collision listener it seems that something in the object changes and breaks the engine. I have tried to call the function in many different ways but the same problem keeps appearing so I think its a problem with the engine. (I console.log() the position and car vars and nothing seems to change).