LayerMask is incorrect

LayerMasks are a natural and easy tool to use. They set a bit for each other mask you specified. For example, I specified two layers in the inspector B, C in the inspector. Thus, the bits set if I have layers A, B, C, D should be 0110. My layerMask variable should EQUAL this value.

It doesn’t.

In my case I have about 12 custom layers, all layers start at layer 8 (Unity’s built in layers are before that). I should see two bits set in the int because I specified B and C. Instead the resulting bits are as follows:

0001 0011 1001 0010 0110 0100

Note that after the first 7 bits (right side) you see 6 bits set.

Why? Any ideas? This clearly is wrong, but the inspector clearly tells me otherwise. I’m not changing this variable at runtime either.

Confirmed it was user error. I converted my layerMask.value to binary but Windows 10’s calculator apparently defaulted to hex, causing me to type in a hex value instead of decimal…