MonoDevelop not happy with javascript

Up until now, my team has been scripting exclusively in C#. Recently we merged our code with another team that has written UnityScript scripts.

The merged code runs fine in the editor. And that other team can debug from MonoDevelop with no problem. But when my team tries, the compilation fails with an error on the first line of every .js file, complaining that it can’t find a reference to UnityEngine.dll (even though it is specified in the References for that project).

The other team is still using Unity 3.3, and I know the way the project files are created changed between 3.3 and 3.4, so I figured I would roll back and see if that made a difference. It’s certainly different, but this time I get compiler errors on a C# line that tries to instantiate SmoothLookAt. It says it doesn’t recognize that type, even though it is in the Standard Assets folder in the same project. Again, it runs fine in the editor.

Help?

3.4.2 should solve this. Please download it and try it, it came out today.

It did solve it! Thank you. But now I’m having a new problem.

Assembly-CSharp-firstpass is not automatically being included as a Reference for Assembly-CSharp or Assembly-UnityScript. As a result, Unity gives me an internal compiler error. I can, of course, add the references in MonoDevelop, which allows it to compile fine, but that doesn’t fix the Unity problem (and then next time I return to MonoDevelop, the references have been set back the way they were).

Is there a way I can tell Unity to include Assembly-Csharp-firstpass as a reference for the others?

Does anybody know how Unity decides which projects will be added as References to other projects?

First Pass is the ‘stuff that gets compiled first’ as per the compilation order manual page. These are added to the non first pass projects present as thats how they depend on them within unity too.

These projects btw don’t do anything that was not done since unity 2 already, it now just visualize much better where a script ends and prevents you from missassuming it :slight_smile:

Ah, that’s where my problem was. Unity-Csharp-firstpass was not actually being added to my other projects as a Reference because Unity was getting stopped in the middle with an “Internal compiler error”.

Once I deleted an unnecessary .dll from Assets/DLLs that had a missing dependency, everything started working fine. Thanks for your help!