assertion error because of bodyactive

Assertion failed: (0 <= proxyId && proxyId < m_nodeCapacity), function GetFatAABB, file /Users/ansca/.hudson/jobs/Main-DMG/workspace/platform/mac/build/Release/Box2D.framework/Headers/Collision/b2DynamicTree.h, line 141.
/Applications/Corona.268/Corona Terminal: line 9: 50806 Abort trap “$path/Corona Simulator.app/Contents/MacOS/Corona Simulator” $*
logout

this happens when I set isBodyActive = false and then remove the body later on [import]uid: 11334 topic_id: 6583 reply_id: 306583[/import]

I had the same issue. I’m glad you found the answer to it.

Thank you for sharing. [import]uid: 12455 topic_id: 6583 reply_id: 23189[/import]

Hello,

I resolved the issue. The problem is when you set “[lua]obj.isBodyActive = false[/lua]” but the obj is still in moviment. To correct this, ensure the obj is stoped. I use:

[lua]obj:setLinearVelocity(0, 0)
obj.angularVelocity = 0
obj.isBodyActive = false[/lua]

I hope this help to all.

Regards.
Francisco. [import]uid: 11749 topic_id: 6583 reply_id: 24413[/import]

Same error happens sometimes (1 per 20 times)

when remove object on “collision” event

remove goes this way:
obj:setLinearVelocity(0, 0)
obj.angularVelocity = 0
obj.isBodyActive = false
obj:removeSelf() [import]uid: 45254 topic_id: 6583 reply_id: 29262[/import]

Be sure you remove your bodies in the next EnterFrame event. Otherwise you will get an error.
Something like that :

[code]
local function remove_object()
object:removeSelf()
object = nil
end

local function onEnterFrame(event)–remove the object in the next frame event
if remove_flag == true then
remove_flag = false
remove_object()
end
end
Runtime:addEventListener(“enterFrame”, onEnterFrame)
[import]uid: 12632 topic_id: 6583 reply_id: 29333[/import]

I’m wondering if there’s any word from the Box2d guys if this is going to actually get fixed properly at some point, or if it’s fixed in the daily builds? This one bug has resulted in almost two days of debugging and work arounds, and I still see it from time to time!

The bug is much less frequent following some of the very handy advice in this thread, but I’m still seeing it. Once I do more cleanup on the code, I may be able to get rid of all remaining instances of it (not my code base, I’m cleaning up/adding features), but for now, it’s just kind of causing some hair tearing. :slight_smile:

in my onCollision event:

self:setLinearVelocity(0,0)  
self.angularVelocity = 0  
self.isBodyActive = false  

and in my onEnterFrame area:

if cleanupFlag == true then local gameTheme = gameSettings["gameTheme"] destroyBullet() cleanupFlag = false if cleanupIndex == 1 then enemy:removeSelf() createOneEnemy(gameTheme, enemy1, 1, -75) elseif cleanupIndex == 2 then etc.... end

The “destroyBullet” code is to get rid of the bullet object, and is similar:

bullet:removeSelf()  
bullet.doneFiring = false  
bullet.isActive = false  

Any help or further advice of course is greatly appreciated [import]uid: 37043 topic_id: 6583 reply_id: 40194[/import]

Well, in further testing, what I’ve done is remove any use of isBodyActive and instead just rely on my cleanup code of :removeSelf(). This can still create a race condition where the player gets hit by something they already destroyed (if the collision happens in the one frame prior to destruction), but it’s a pretty rare case, and a solveable one.

However, it would be great to hear that the underlying Box code was fixed to make isBodyActive usable in most cases. Or deprecate it in favor of a newer, better method.

Thought I’d share that, since I’m guessing I’m not the only one having the problem. Cheers, and thanks Box2D and Corona! Despite debugging frustrations, this library still saves weeks of time, so don’t think I/we’re not grateful! :slight_smile: [import]uid: 37043 topic_id: 6583 reply_id: 40576[/import]

I think Jon Beebe has a good post about this issue.
http://jonbeebe.tumblr.com/post/2515495262/corona-collision-no-no

cheers
adrianEraldo

[import]uid: 12407 topic_id: 6583 reply_id: 44294[/import]

“Warning: could not load the font helvetica-bold.”
how to get rid of it?
I want to use helvetica-bold.
please help. [import]uid: 176812 topic_id: 6583 reply_id: 129353[/import]

And another problem is that until the car collides with the middle point of the bunnies or hurdles the collusion occurs only then. I want it to occur even if the player object hits the bunnies. kindly help me in this regard. It will be deeply appreciated! Thanks. [import]uid: 176812 topic_id: 6583 reply_id: 129354[/import]

“Warning: could not load the font helvetica-bold.”
how to get rid of it?
I want to use helvetica-bold.
please help. [import]uid: 176812 topic_id: 6583 reply_id: 129353[/import]

And another problem is that until the car collides with the middle point of the bunnies or hurdles the collusion occurs only then. I want it to occur even if the player object hits the bunnies. kindly help me in this regard. It will be deeply appreciated! Thanks. [import]uid: 176812 topic_id: 6583 reply_id: 129354[/import]