- Home /
compiler error when entering play mode
when entering play mode, get error message: "all compiler errors have to be fixed before entering play mode." Console says:
Assets/Standard Assets/Image Effects (Pro Only)/ColorCorrectionEffect.cs(6,14): error CS0101: The namespace global::' already contains a definition for
ColorCorrectionEffect'
I added some tutorial assets, then got this state to my project . Creating a new project does not help... How to fix this?
Answer by Owen-Reynolds · Jan 27, 2013 at 03:07 PM
"already contains a definition forColorCorrectionEffect" is telling you that you have added ColorCorrectionEffect
twice to your project. Look to see if you have two copies, and delete one. I'd guess you were following along, grabbed that file and thought it didn't work, but you really put it in the wrong folder, then tried again and got copy #2 in the correct folder.
You'd think since they are the exact same, having two copies would be fine -- it won't matter which one it runs. But it's a pain to check they are identical, and one could be changed to be different later. So easier to yell at you now to pick just one.
sorry seems that still I face the same problem in an other project. So how to search, and delete copies? I am new to scripting, so basic search etc is not evident for me. I can find the location in script that refers to ColorCorrectionEffect, but then what to do, how to control the namespace?
Answer by 1ukka · Jan 29, 2013 at 07:28 AM
ok thanks! Is it ok to delete a script, or module? Is there any advice how to organise folder structure to avoid this?
We're trying to keep text arranged as possible answers or as comments/replies on answers.
Best to delete assets from within Unity (not by going to the folder in your computer and deleting, which can confuse Unity.) Even it something was using it, Unity won't break -- just show a hole in the slot where it was.
Folders are just folders. Arrange them the same as you arrange your Documents directory. In practice, you'll never have a problem with duplicate scripts. As soon as you add the 2nd one, anywhere, Unity will yell at you right away.
Your answer
Follow this Question
Related Questions
how to fix third person 1 Answer
Is there a way to make TouchPhase.Moved less sensitive? 1 Answer
BCE0044: expecting (, found 'Update'. 0 Answers
how do i disable a mesh 2 Answers
compiler playmode error 0 Answers