So, I reported this bug a while ago but it was closed as “by design” and I didn’t get a further response, so I’d like to post it here and get a second opinion. The bug:
Terrain objects, like trees, do not properly inherit the Layer of the terrain they are on. For most things, including Camera culling, physics collisions, and getting the component’s layer by code, it returns the Terrain’s layer. But for Raycast layer masks, they act as if they are on whatever layer was set in the tree prefab. Original dev response was that this was “expected behavior”, but I think that’s kinda ridiculous. Raycasts should use the same layer assignment as every other aspect of Unity; it doesn’t make any sense for there to be a single exception to how layers work that is not documented anywhere. This is doubly important for SpeedTrees since I can’t figure out a way to actually change the layer that their prefab is on, since it is set to “Default” and greyed out.