I've finally figured out why my layer masks for my ground collision code weren't working. I was using NameToLayer()NameToLayer() to get the layer I needed, but Layermaskslayer 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"); mask = 1 << LayerMask.NameToLayer("Default"); when something like this:
mask = LayerMask.NameToLayer("Default"); mask = LayerMask.NameToLayer("Default"); makes more intuitive sense and works similar to the rest of the Unity API?
(Is that the right use of the term API? I don't actually know what that word means, so I've been inferring it from context.)