Physics Bodies in Multiple Groups Can't Collide?

I’ve got two physics bodies (let’s call them bars) in a displayGroup that don’t seem to collide with a physics body (let’s call it the ball) outside their group. I have my filters set up properly. The ball does collide with the floor.

Is there a problem colliding between groups? Is there documentation in this regard? I’ve searched the forums and even tried IRC but can’t find the answer to this one.

Thank you!
[import]uid: 61132 topic_id: 10647 reply_id: 310647[/import]

Collision between 2 physics objects, each in a different group (groupA and groupB) works fine in this example:

[code]
local physics = require( “physics” )
physics.start()

local groupA = display.newGroup()
local groupB = display.newGroup()

local myCircle = display.newCircle(groupA, 100, 100, 30 )
myCircle:setFillColor(128,0,0)
physics.addBody( myCircle, { density=3.0, friction=0.5, bounce=0.3 } )
local myRectangle = display.newRect(groupB, 0, 300, 480, 20)
myRectangle:setFillColor(0,0,200)
physics.addBody( myRectangle, “static”, { density=3.0, friction=0.5, bounce=0.3 } )

local function onCircleCollision(self, event)
if event.phase == “began” then
print(“collided”)
end
end

myCircle.collision = onCircleCollision
myCircle:addEventListener( “collision”, myCircle )
[/code] [import]uid: 48658 topic_id: 10647 reply_id: 38724[/import]

Your code worked as expected for me.

However, I found somewhere in the docs (or maybe the forum) that suggested that physics bodies in different groups might behave unexpectedly… So I’ve put them all in the same group for now. :-/

I will get back to attempting to regroup them at some later date.

Thank you for the help!
[import]uid: 61132 topic_id: 10647 reply_id: 38745[/import]