Hey just ran into a little problem, I wasn’t getting it before.
I’m trying to build but I keep getting this error. Its literally line 2, “using UnityEditor;”
Its happening with one other scriptable object as well. Oh, and it compiles in the editor fine.
larku
2
The UnityEditor namespace is only available in the editor and for editor scripts. It is not available at runtime (hence not available when building).
Are you trying to use something from the UnityEditor namespace in your script? If not, remove the using directive.
Yeah I ended up doing that, I just thought since I have other scripts with UnityEditor that didn’t affect it before, it shouldn’t have now.
larku
4
Are you sure your other scripts have Unity**Editor**? If they’re not editor scripts they’re most likely ‘using’ Unity**Engine**.
Either that or there’s a #if UNITY_EDITOR ... #endif enclosing it.
1 Like
Technically not my scripts, but assets I’ve bought. And yes, you are right, that’s what’s happening.
1 Like