- Home /
Problem accessing C# from Javascript
I realize this question has been asked several times before, but I have tried everything. I am trying to access a C# boolean from a JS Script, but I can't move my C# boolean to the Standard Assets or Plugins folder without breaking my project. I also moved the execution order of the C# script to before the script calling it. I am using the UFPS plugin by visionpunk.
In this screenshot, I have my code on the left and my scene on the right. I successfully tested the boolean calling with a dummy script and it worked, but it was in the Plugins folder, so it was compiled first. In this case, line 181 works (script is in plugins folder) but line 182 does not. Again, I cannot move the script with the boolean. http://puu.sh/4U3UW.jpg
Any help is tremendously appreciated.
Why can't you move the script into a Plugins Folder?
Answer by Andrea_Marchetti · May 25, 2017 at 02:57 PM
How did you resolve? I have a package in C# and I am trying to access it from Unityscript files. But I can't move the package folders into Plugins or Standard Assets because the code in the package gives me error, script not found.
Can you post some screenshots of your code and more details about your issue, like any console errors you have?
The error showing up was it didn't find any class named like the one I was trying to access. And if I moved the package's folder into Plugins or Standard Assets then some code in the package was giving me error 'cause it could not find the directory in the original path, and if I remember correctly I could not open the script?... Or maybe I did not try?... Strange...
Anyway, in the end I understood that there was no way to use that plugin (Google Play Services) which was written in C# in a project where everything else was written in Unityscript. So I translated the whole project in C#. I will never have issues like this again. C# from now on.