- Home /
Lines of code appearing out of nowhere? Real spooky
So I was getting an error when building "Cannot build player while editor is importing assets or compiling scripts". When I looked up this issue, I was told that it's because I have scripts using Unity.Editor that aren't in the Editor folder.
Well, that made no sense since the last build (today) worked and I hadn't added any new scripts with Unity.Editor. I go to check my scripts, and strangely, MULTIPLE scripts are using Unity.Edtior. I know for a fact I didn't do that cuz I've had these scripts for months and have built the project just fine. Now I have to go through every single script I have to see if they've also been affected, so far, I 've gotten 6 scripts. But I still get the error, which means somewhere, more scripts are bugged.
Why did this happen, and is there a way I can revert to a version before it happened?
EDIT: I've gone through all my scripts and removed 'Using Unity.Editor' but I still get the error message when I try to build.
Answer by OmegaFalcon · Sep 20, 2020 at 05:55 AM
So. I got the project to build. I found this line of code in one of my scripts "Using System.Security.Policy;" which I 100% did not put there. I basically went around deleting things I never wrote. It's very strange, and I worry that there and a lot more random things written in my code.
Your answer
![](https://koobas.hobune.stream/wayback/20220613012208im_/https://answers.unity.com/themes/thub/images/avi.jpg)