Problem in accessing a script variable from another variable....

Hi . I have two c# classes in the same scene, but I cant use the first variables into the second one, here is my code :

public class MainCode : MonoBehaviour {
void Update () {
            hit = new RaycastHit() ;  
                ray =Camera.main.ScreenPointToRay ( (Input.mousePosition)); 
              if (Physics.Raycast(ray, out hit, 7000))  
            point1 = hit.point ;        

and my second one is : 
public class movment :  MonoBehaviour  {
    void Update () {
        if (Input.GetMouseButtonDown(0) ) 
        {   // here i need to use the point1 which is in MainCode class  
           // print(point1.toString());


In your class MainCode you need to make point1 a public variable. Then inside of your class movement you need to have a reference to the instance of MainCode like so:

`public MainCode mainCode`

Then from inside of movement you'll be able to say `print(mainCode.point1);`

Hope that helps.