Code:
public function Destroy_box(e:Event) {
var contact:b2Contact=the_world.m_contactList;
if (contact != null) {
if (contact.GetShape1().GetBody().GetUserData()=="Ground") {
var body3=contact.GetShape2().GetBody();
the_world.DestroyBody(body3);
}
}
}
var contact:b2Contact=the_world.m_contactList;
if (contact != null) {
if (contact.GetShape1().GetBody().GetUserData()=="Ground") {
var body3=contact.GetShape2().GetBody();
the_world.DestroyBody(body3);
}
}
}
I want to destroy some boxs when contact with the ground
but it have a error:
Code:
1178: Attempted access of inaccessible property m_contactList through a reference with static type Box2D.Dynamics:b2World.
How can i solve it?