CS0246 error (missing type / namespace) of the target class in an Editor class

Hi,

I’ve got this script that was actually working before but not now:

[CustomEditor (typeof(GridObject))]
public class GridObjectEditor : Editor {
  
    GridObject gridObj;
  
    public void OnEnable()
    {
        //Settings
        gridObj = (GridObject)target;
        SceneView.onSceneGUIDelegate += this.GridObjectUpdate;


        gridObj.gameObject.layer = LayerMask.NameToLayer("GridObjectLayer");

        SetCollider();


        //gridObj.transform.localScale = new Vector3(GridMap.gridWidth, GridMap.gridHeight, GridMap.gridHeight);
    }
...
}

FYI, the ‘GridObject’ class is in the “Scripts” folder while the ‘GridObjectEditor’ class is in the “Editor” folder. I tried rebuilding it and en error saying: “The type or namespace name ‘GridObject’ could not be found (are you missing a using directive or an assembly reference?) (CS0246) (Assembly-CSharp-Editor)”. But the weird part is, it actually worked in the past. I only added some code that doesn’t have anything to do with this editor class at all. And when I rebuilt it all, this happens. Why is this happening? Can anybody help me here? Thanks in advance.

In the mean time, I’ll put the scripts in the “Plugins” folder because AFAIK that “Plugins” are compiled before the “Editor”. Which is not entirely correct because these are not scripts for a plugin but the core of the application itself. And it doesn’t explain why it worked in the first place.

Should work. There is a bug though where sometimes editor scripts dont recognize non-editor scripts, i have no idea how to ‘fix’ it.

Thanks for the reply. That’s weird. Has anybody tried reporting the bug?