Image
Top
Menu
July 15, 2010

Unity3D Beginners Tip Of The Day: Dealing with Error “BCE0018: The name… does not denote a valid type.”

I ran into this problem when I tried to access a function in a class/script that I’ve downloaded from the wiki from another script that I wrote. I kept getting this BCE0018 error telling me “The name (class name) does not denote a valid type”. It took me a while to find out that it is because the script I downloaded was written in C#, and the script I wrote was in Javascript – and due to the way scripts are compiled in Unity3D, I need to have the C# script in “Standard Assets” folder and the Javascript outside of that folder for it to work. Read more on this page Script Compilation

 

All scripts that are compiled in this step have access to all scripts in the first group (“Standard Assets”, “Pro Standard Assets” or “Plugins”). This allows you to let different scripting languages interoperate. For example, if you want to create a Javascript that uses a C# script: place the C# script in the “Standard Assets” folder and the Javascript outside of the “Standard Assets” folder. The Javascript can now reference the C# script directly.

 

 

 

Posted By

Categories

Blog Posts, Unity3D

Tags