The layer of the gameobject is successfully changed to the new layer. However, the .excludeLayers gets set to ‘Default, Ignore Raycast, Water’. In my eyes this should be set to ‘Black’, right?
For another test I’ve added the layer “Red”, change the code accordingly from Black to Red. Now .excludeLayers is set to ‘Ignore Raycast, Water’.
MelvMay, I find your reply quite unprofessional and unhelpful.
I did notice one is plural and the other is not. But the solution ‘GetMask’ isn’t plural either.
TBH, You assume I didn’t read the docs, I however did. But maybe, just maybe, it didn’t help me and that’s why I asked a question. And afaik, that’s what these forums are for.
It’s unfortunate you find suggesting that you read the docs unprofessional and unhelpful being as they do state that the property requires a “LayerMask” and that NameToLayer doesn’t return that type. It’s also unfortunate you didn’t understand the docs but it’s not unprofessional to suggest you read them and to highlight why they’d give you the answer if you looked closer.
A mask is singular because it is a single thing, a mask which contains the specification of layers. A bit-mask is a fundamental thing in programming where each bit is used as a flag.
The scripting docs assume a basic working knowledge of such things for sure.
Because unfortunately that’s extremely prevelant on these forums. It seems you did read them but didn’t understand them.
Look, you’re right. And yes, people should read the docs, and I did. The thing I found was “unprofessional” is that your comment felt degrading to me. Maybe it’s how I read it, things can “sound” different online as you know since there is no context further then the actual text.