I've finally figured out why my layer masks for my ground collision code weren't working. I was using NameToLayer()
to get the layer I needed, but layer masks use bit shifting to actually set the layer mask value. This is extremely unusual and I don't see any reason why this isn't handled in the code behind. Why do we have to use code like this:
mask = 1 << LayerMask.NameToLayer("Default");
when something like this:
mask = LayerMask.NameToLayer("Default");
makes more intuitive sense and works similar to the rest of the Unity API?