Search Issue Tracker
Fixed in 5.3.0
Votes
10
Found in
5.0.0f4
Issue ID
681865
Regression
No
LayerMask.GetMask() ignores the "Default" layer
How to reproduce:
1. Open a new project
2. Create a script named GetMaskBug.cs with the following contents:
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class GetMaskBug : MonoBehaviour {
public LayerMask defaultMask;
public LayerMask ignoreRaycastMask;
public LayerMask waterMask;
void OnValidate () {
defaultMask = LayerMask.GetMask("Default");
ignoreRaycastMask = LayerMask.GetMask("Ignore Raycast");
waterMask = LayerMask.GetMask ("Water");
}
}
3. Save the script and return to the editor
4. Attach the script to any object in the scene
- Note how the Default Mask property says "Nothing" while the rest appear to work fine
- This also happens when using LayerMask.GetMask(LayerMask.LayerToName(0))
Comments (4)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- The layout system is failing to correctly calculate or apply the height of the Japanese fallback font when the primary English font's metrics are used
pippo4president
Nov 08, 2016 20:27
Had similar issue when my layer was named "Enemies", switched name to "Monsters" and everything worked as expected. This was in Unity 5.4.1f1 in Linux
mateiasu
Feb 27, 2016 16:30
You can remove the last comment. I accidentally opened 5.1.0 ...
mateiasu
Feb 27, 2016 16:19
Can we please reopen this? I'm experiencing this in 5.3.2f1.
grrosegr
Mar 27, 2015 19:05
Yep, also got this issue.