Read var from Javascript in c# script

Is it possible to read a var form Javascript into a c# script? If so, how do you do this?

I’ve a javascript file called APCounter.js (attached to APCounter gameobject) and a c# file called GameSaveLoad.cs (attached to a different gameobject).

I’m using the following code in the c# script:

GameObject APCounterObject = GameObject.Find("APCounter");
APCounterScript = APCounterObject.GetComponent(typeof(APCount)) as APCount;

I get an error saying that APCount cannot be found.

You need to have your APCounter.js in a “plugins” directory so it’s compiled first so it’s visible to your C# code as per: Unity - Scripting API:

Thanks! It works now