Hey, guys!
So... I stumbled upon an odd error. I use scene manager and I my minigames inside my game are scenes. The problem is, when I try to create a "restart", which would mean a scene change to the same scene. But when I try that it gives me this critical error:
"Assertion Failed!
Program: C:\Program Files (x86)\Gideros\GiderosPlayer.exe
File:..\external\Box2D_v2.2.1\Box2D\C...\b2Dyna...ree.cpp
Line: 127
Expression: m_nodes[proxyId].IsLeaf()"
I did some research and found nothing about it... I mean, I know it's related to the usage of box2D in my minigame, but what could this error mean?
Comments
I have just looked at that line in the box2d source and it appears box2d is trying to destroy something that doesn't exist.
I would suspect that your scene has a
As I said, I'm not 100% sure this is the case (or for that matter how box2d would respond to multiple calls to require but I do suspect this has something to do with your problem).
Maybe @atilim might be able to shed a little more light on the subject.
Likes: AxlFlame
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
When you say init.lua, that means my main class, right? I ask cause I don't have any init.lua, only a main.lua.
How can I keep a global reference to it? It's something like this?
Likes: AxlFlame
Likes: AxlFlame
Likes: AxlFlame
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
I tried to debug my onExitBegin method because I thought it could be related, as the problem happens when I try to exit my scene and change to the same scene.
I found out that the Assertion Failed happens right when the method is cycling through the sprites on the scene to destroy them.
Is it trying to destroy a body that doesn't exists anymore? If it is, why this problem doesn't happen when I exit my scene to another scene??
I'm going crazy on this
Is bridge not a child of your scene already? If it is then aren't you trying to destroy bridge.body twice? That may be related to the problem.
Likes: AxlFlame
Also, the assertion failed happens before my code gets to the "If bridge.body then" part...
Btw, thanks for the insight on the "require"!