Types and namespace not found...

Ok, so I’m new to Unity and C# but I wrote a tiny script which runs without a problem inside Unity.
But when I try to export it (build) I get a bunch of errors all telling me types are not found, and it’s pretty much all the types I used… So it doesn’t find MonoBehaviour, Vector3 or Transform.

The script looks like this :

  • using System.Collections.Generic;
    using UnityEngine;
    public class CameraBehaviour : MonoBehaviour {
    Vector3 myVectorZ;
    Vector3 myVectorY;
    Vector3 myVectorX;
    Transform myTransform;
    void Awake () {

      myTransform = GetComponent<Transform> ();
      	
      myVectorZ = new Vector3 (myTransform.position.x, myTransform.position.y, myTransform.position.z+2);
      myVectorY = new Vector3 (myTransform.position.x, myTransform.position.y+2, myTransform.position.z);
      myVectorX = new Vector3 (myTransform.position.x+2, myTransform.position.y, myTransform.position.z);
    

    }
    // Use this for initialization
    void Start () {

    }

    // Update is called once per frame
    void FixedUpdate () {
    if ( Input.GetKey( “space” ) )
    { transform.Translate( myVectorZ , Space.Self);
    Debug.Log (“Fixed :”);
    Debug.Log (myTransform.position.z); }
    }
    void Update () {
    if ( Input.GetKey( “space” ) )
    { transform.Translate( myVectorZ , Space.Self);
    Debug.Log (“NotFixed :”);
    Debug.Log (myTransform.position.z); }
    }
    } *

I’m guessing I didn’t think of a simple thing that ruin everything but I didn’t find an answer fitting my problem.
Sorry if I’m not clear, not english… Thanks in advance for your answers !

Actually I managed to finally fix it !

I was having errors when trying to export for windows only, I succeeded to build for Html5, but when I tried the windows thing I kept getting errors like “The type or namespace name XXX could not be found (are you missing using directive or an assembly reference?)” for every type I put in the code.

The problem came from the Facebook exporting module for some reason, I got rid of it directly in the Plugin folder and now I can build for Windows.

Absolutely no idea why it’s connected though :confused:

Thanks for your answers and if you have a way to reinstall the facebook module without getting this error again ! :slight_smile: