Hi all!
I’m really struggling to get a LayerMask working in an editor script.
I have the variable
public LayerMask collisionLayer;
It looks like EditorGUILayout.MaskField is the way to go but I can’t figure out the ‘displayedOption’. Do you have to manually enter each layer in?
Could someone point me in the right direction?
Thanks,
Pete
EditorGUILayout.MaskField seems to be used to create a custom list and the displayedOption seems to be the custom list/array of options that you provide.
Maybe LayerField is what you look for to create LayerMask selection?
Okay cool, but with EditorGUILayout.MaskField, it seems that you have to manually add all of the layers with a string array.
Is there a way to automate that? It seems a bit tedious, and potentially problematic.