Hi! While developing my project, I encountered a " * A Class already exists with the same classname : “ColumnElement” error, although there is no duplicate as you see below.
I tried to follow instructions from similar chinese thread (cannot post links, sorry) through google translate but it didn’t help.
Is it a fixable error, or I’m better of by recreating the project?
Also, just noticed, as a part of this, when I try to add a custom component to node, I see two of ColumnElement scripts, though there’s only one
Can you check are there have any duplicate class defintion in your files? The file name is not have to be the same as the class name
Only one class in each script, and their class names are the same as file (old habit from Unity) so yeah, no repeated definitions
So, after 4 hours down the pipe, i’ve found the solution:
- One of my classes ,Level, imported, amongst others, the MovingElement class.
- And MovingElement was importing Level for some usefull functions.
This was somehow make them clash which to import first and it gave the error. The solution is basically refactoring this to classes, so only one of them imports the other (in my case I’m going to move every variable and function needed to MovingElement)
Hope it helps if someone finds this page in 5 years