Enable javascript from C# attached to the main camera

I am trying to figure out how I can enable and disable a javascript (Plates_p) which is attached to my main camera from another C# script. I have tried this:

Camera.main.GetComponent<Plates_p>().enabled = false;

This throws this error: The type or namespace name `Plates_p’ could not be found. Are you missing a using directive or an assembly reference?

I have also tried this:
Plates_p myscript;

This throws the same error? How do I solve this?

Any help is appreciated :slight_smile:

If you want to access you Unityscript (javascript) classes through c# then you must place your Unityscripts in the Plugins folder. Unity will recognize the Plugins folder as a special folder and compile those particular files in a different order.

So, create a folder called “Plugins” in the root of your project and place the “Plates_p” class there. Hope it helps!