- Home /
type not found
Hi, I'm trying to use javascript object from c# class. I've read about compiling priority and I have put JS file inside standard assets folder. C# script (in /Scripts fodler) which is calling JS object (in Standard Assets (mobile) folder) like this
MyInfo myInfoObj = gameObject.GetComponent("MyInfo") as MyInfo;
gives me an error
error CS0246: The type or namespace name `MyInfo' could not be found. Are you missing a using directive or an assembly reference?
What do I have wrong? thanks.
Answer by stan4unity · Jan 14, 2012 at 11:04 PM
I had to put the js script to Plugins folder. Standard assets didn't help even the calling c# was placed in /scripts folder. Maybe something with iOS target platform? Standard assets has (mobile) next to it. Because the js script was calling other 2 js scripts I had to move also these. Its kind of funky I may easily end up having all mu js scripts in plugins ;o(
Your answer
Follow this Question
Related Questions
The name 'TrackManager' does not exist in the current context [Unity Vuforia Ground Plane Project] 0 Answers
Converting a JS script into C# - hit a wall with arrays... 1 Answer
Fix "Type size exists in both System.drawing and netstandard" 1 Answer
what's wrong with this?? 2 Answers
Serialisation: InvalidCastException: Cannot cast from source type to destination type. 1 Answer