<stupid mode>
I was. I've never needed to use multiple ones before.
Anyway, I added a new layer last night and was getting stuff highlighting when it shouldn't be. After 45 minutes of fannying about and getting different but still wrong results, I noticed something interesting.
I was using constants for my layers and assigning values of 1, 2, 3, 4, 5 and so on. I didn't realise at the time but by using a value of 3, I was actually adding stuff to collision layer 1 *and* layer 2.
They're actually referenced by values 1, 2, 4, 8, 16... and so on.
I now realise that its been done this way so you can check for collisions on multiple layers at once, but it confused the hell out of me for a while.
</stupid mode>
I was. I've never needed to use multiple ones before.
Anyway, I added a new layer last night and was getting stuff highlighting when it shouldn't be. After 45 minutes of fannying about and getting different but still wrong results, I noticed something interesting.
I was using constants for my layers and assigning values of 1, 2, 3, 4, 5 and so on. I didn't realise at the time but by using a value of 3, I was actually adding stuff to collision layer 1 *and* layer 2.
They're actually referenced by values 1, 2, 4, 8, 16... and so on.
I now realise that its been done this way so you can check for collisions on multiple layers at once, but it confused the hell out of me for a while.
</stupid mode>