Android IDE (AIDE) Support Forum

Destroy bodies in libgdx box2d

How can I destroy a body in libgdx box2d?

1 Like

Command is:

world.destroyBody (body);

but if you call this inside collision listener it gonna crash.

Possible solution:

  1. do post destroy function outside of collision listener