Hi,
I'm trying to make a game where you can shoot objects out of a cannon, and I need to prevent the cannon from colliding with the objects, but both the cannon and the objects should collide with the terrain. Because this is just a simple exception of collision between 2 types of objects, I'd like to run a quick check on the userdata of the fixtures and if one of each of the fixtures is from the cannon or the objects it shoots, i'd like to disable the contact.
This is my code:
box2dWorld.addEventListener(ContactEvent.BEGIN_CONTACT, filterContacts)
private function filterContacts(e:ContactEvent):void
{
FlashConnect.trace(e)
}
However, I even though my game runs fine, nothing is ever traced... Am I doing something wrong?
Thanks,
-Hamed
I'm trying to make a game where you can shoot objects out of a cannon, and I need to prevent the cannon from colliding with the objects, but both the cannon and the objects should collide with the terrain. Because this is just a simple exception of collision between 2 types of objects, I'd like to run a quick check on the userdata of the fixtures and if one of each of the fixtures is from the cannon or the objects it shoots, i'd like to disable the contact.
This is my code:
box2dWorld.addEventListener(ContactEvent.BEGIN_CONTACT, filterContacts)
private function filterContacts(e:ContactEvent):void
{
FlashConnect.trace(e)
}
However, I even though my game runs fine, nothing is ever traced... Am I doing something wrong?
Thanks,
-Hamed