Accessing GameObjects Scripts!

hi! im new here, also new at Unity so forgive me if im asking a stupid question!! (the first one of many to come!!) :smile: :smile:

Im trying to access a script located in a GameObject form another GameObject This is what ive been trying (using C#)

public class NewBehaviourScript : MonoBehaviour {

private GameObject Target;
private CameraScrolling cam;

void Start () {

Target = GameObject.Find(ā€œMain Cameraā€);
cam = (CameraScrolling)Target.GetComponent(typeof(CameraScrolling));

}

CameraScrolling is a JavaScript script located in the gameobject called ā€œMain Cameraā€

so, when i try to compile, it gives me this error:

Assets/NewBehaviourScript.cs(8,17): error CS0246: The type or namespace name `CameraScrolling’ could not be found. Are you missing a using directive or an assembly reference?

could this error be beacuse i`m trying to access a js script froma a c# script?!?!

please help!!

Possibly. Using different scripts can have some problems. There’s a documentation article mentioning this and ways to avoid it. Basically, scripts that compile at the same time should be of the same language. For example, scripts under ā€œPluginsā€ get compiled first then the others. So, Plugins can be one language and GameObject scripts another, but I wouldn’t use multiple GameObject or Plugin scripts with different languages to be safe.

Here’s the article I was referencing: