I’m confused about how to write complex collision filters. I feel like I understand the red balloon vs blue balloon sample, but when adding more objects it does not seem to follow the pattern.
From the sample:
local redCollisionFilter = { categoryBits = 2, maskBits = 3 }
-- red collides with (2 & 1) only
local blueCollisionFilter = { categoryBits = 4, maskBits = 5 }
-- blue collides with (4 & 1) only
I assumed that if I added a third filter “green” with category of 6 and mask of 7 that it would collide with 6 and 1 only. However this does not seems to be the case.
How does the formula work for adding more filters?
My goal is two have 4 objects that each shoot their own set of bullets. The objects cannot crash into each other or their own bullets, but they can crash into each others’ bullets, so how do I go about writing that?
[import]uid: 10903 topic_id: 9428 reply_id: 309428[/import]
[import]uid: 48521 topic_id: 9428 reply_id: 34519[/import]