- Home /
Give help to fix this error
After I add plugin.cs to my project, I couldn't build my project at all. Because of this error.
BCE0018: The name 'm_plug' does not denote a valid type ('not found'). Did you mean 'UnityEngine.MissingReferenceException'?
I defined m_plug in java-script file.
Please give me your help.
Answer by Persona · Dec 04, 2011 at 03:48 AM
Did you define whether it was a gameObject, transform, script, etc?
If you didn't that was the problem. You'll need to post the script for more help though.
No, it's obviously an m_plug. Which the C# script doesn't know about.
Answer by syclamoth · Dec 04, 2011 at 03:54 AM
The problem here is that you are trying to use a Javascript type in a C# script. Because the two are compiled separately, you can't use types from one with the other.
Basically this is a good case for picking one language (be it C#, JS or Boo) and sticking with it for everything- the languages aren't fantastic at communicating with each other.
Answer by aldonaletto · Dec 04, 2011 at 11:32 AM
You can create a folder Assets/Scripts (or the name you prefer), and put your JS scripts there. Unity compiles Assets/Plugins, Assets/Standard Assets and Assets/Pro Standard Assets first, then the Editor subfolders inside them, and finally the scrips stored in other folders - like the Assets/Scripts I suggested. Scripts compiled in the first wave can be "seen" by scripts compiled after, thus the JS scripts will be able to use CS scripts in Plugins - but not the other way around: a script already compiled can't see the others compiled after.
Thank for your help. I inserted my CS scripts in Assets/Pro Standard Assets and put my JS Scripts in Assets/Scripts, But the error doesn't disappear. The error is the same. The name 'm_plug' does not denote a valid type ('not found'). Did you mean 'UnityEngine.$$anonymous$$issingReferenceException'?. m_plug was defined in Assets/Scripts/GlobalPlay.js such as .
Your answer
Follow this Question
Related Questions
Editing the jumppad from the 3rd person tutorial 2 Answers
Missing Script? 1 Answer
Error BCE0018 0 Answers