hi! im new here, also new at Unity so forgive me if im asking a stupid question!! (the first one of many to come!!)
![]()
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!!