Collision filter help, so close to getting solved

Hello, I have two objects (blue, green) and two corresponding goals (blue, green) that they have to reach.
I have set up two filters for each of the objects and it works fine when they have to reach the desired goal; blue goes to blue, green goes to green.

Problem: I don’t want the blue and green objects to ignore each other (I want them to bounce off of each other if they hit), just the the goal that they don’t belong to.
Can anyone help?

[code]
– set the blue and green filters
local blueCollisionFilter = { categoryBits = 2, maskBits = 3 }
local greenCollisionFilter = { categoryBits = 4, maskBits = 5 }

– give each of the goals their filter
local goal = display.newImage( “obstacles/goal-small.png” )
physics.addBody( goal, “static”, { filter = blueCollisionFilter, radius = 20, isSensor = true } )

local goal2 = display.newImage( “obstacles/goal2.png” )
physics.addBody( goal2, “static”, { filter = greenCollisionFilter, radius = 20, isSensor = true } )


– HERE’S THE PROBLEM, because they have different filters, I still need the objects to interact with each other

blueObj = display.newImage(“balls/blue”)
physics.addBody( blueObj, “dynamic”, { density = 0, friction = 3, bounce = 0.1, radius = 14, filter = blueCollisionFilter } )

greenObj = display.newImage(“balls/green.png”)
physics.addBody( greenObj, “dynamic”, { density = 0, friction = 3, bounce = 0.1, radius = 14, filter = greenCollisionFilter } )
[/code] [import]uid: 42126 topic_id: 23592 reply_id: 323592[/import]

I’m not able to help much without having a test project with all those things in-place/moving around, but this chart might help you solve your issue:

http://developer.anscamobile.com/forum/2010/10/25/collision-filters-helper-chart

It’s a really, really great resource for those who use collision filters. [import]uid: 52430 topic_id: 23592 reply_id: 94620[/import]

Thank you for the help. It worked.
The solution:

[code]
local ballCollisionFilter = { categoryBits = 1, maskBits = 7 }
local goalCollisionFilter = { categoryBits = 2, maskBits = 3 }

local ball2CollisionFilter = { categoryBits = 4, maskBits = 13 }
local goal2CollisionFilter = { categoryBits = 8, maskBits = 12 }
[/code] [import]uid: 42126 topic_id: 23592 reply_id: 94635[/import]