Yesterday I tried to set up some collision categories for my game but they doesn’t seem to work. I tried a lot of combinations as you’ve wrote in the Game Edition Guide, but my objects didn’t respect them. I checked carefully and a lot of times so it may be a bug of GE.
Has someone else noticed errors with collision categories? [import]uid: 7022 topic_id: 1360 reply_id: 301360[/import]
Nope, works fine for me. [import]uid: 5712 topic_id: 1360 reply_id: 3749[/import]
Thanks Mike. I’ll check again.
[import]uid: 7022 topic_id: 1360 reply_id: 3753[/import]
Which masks and categories did you set and experienced the wrongly behaviour? [import]uid: 5712 topic_id: 1360 reply_id: 3754[/import]
Here they are:
[lua]firstCollisionFilter = { categoryBits = 4 , maskBits = 3 } – THIS SHOULD COLLIDE WITH THIRD FILTER
secondCollisionFilter = { categoryBits = 4 , maskBits = 3 } – THIS SHOULD COLLIDE WITH THIRD FILTER BUT NOT WITH FIRST
thirdCollisionFilter = { categoryBits = 1 , maskBits = 6 } – THIS SHOULD COLLIDE WITH FIRST AND SECOND FILTER.[/lua]
What’s wrong?
[import]uid: 7022 topic_id: 1360 reply_id: 3755[/import]
Yes, your bit calculation is wrong. Category and mask are bit values, but presented in decimal values. So you
have the following right now, displayed in bits
firstCollisionFilter = { categoryBits = 100 , maskBits = 011 }
secondCollisionFilter = { categoryBits = 100 , maskBits = 011 }
thirdCollisionFilter = { categoryBits = 001 , maskBits = 101 } [import]uid: 5712 topic_id: 1360 reply_id: 3777[/import]
I have not used that SDK yet … but from what I “guess” it needs to be like that…
01 - 11
10 - 11
11 - 11
1,3
2,3
3,3
? 
(may be totally wrong… though… hehe) [import]uid: 6928 topic_id: 1360 reply_id: 3757[/import]