Type or namespace error

So while coding, I was going to use some Unity Editor stuff in script, and I looked up how to fix the first error (Where you can’t compile or anything) by placing my script in a folder named Editor. But that makes it so that nothing else can reference the script in the Editor folder.

Anyone know how to fix this?

Runtime scripts should in general not reference editor scripts. Are you are trying to do? It might help, if you could explain your use case to find a different solution.

I’m trying to build the navmesh whenever I run a script.

one way to execute editor code is to precede the method with

[MenuItem("MyParentMenu/MySubMenu/MyMenuItem")]

and select this menu item to execute the method