So, I found an old scene I was working on which contained a cube, plane and a simple script to move the cube, works perfectly. When I paste this code into a new scene with a new cube and plane, i get the error "Associated script can not be loaded, please fix compile errors. as far as I can see it compiles fine.
Here is the code, any help would be greatly appreciated. (console "the referenced script on this behavior (main object camera) is missing.
using UnityEngine;
using System.Collections;
public class movement : MonoBehaviour
{
public float speed = 5.0f;
void Update ()
{
if (Input.GetKey (KeyCode.UpArrow))
{
Debug.Log (“Key UpArrow Pressed.”);
this.transform.Translate (new Vector3 (0, 0, speed * Time.deltaTime));
}
else if (Input.GetKey (KeyCode.DownArrow) )
{
this.transform.Translate (new Vector3 (0, 0, -speed * Time.deltaTime));
}
else if (Input.GetKey (KeyCode.LeftArrow) )
{
this.transform.Translate (new Vector3 (-speed * Time.deltaTime, 0, 0));
}
else if (Input.GetKey (KeyCode.RightArrow) )
{
this.transform.Translate (new Vector3 (speed * Time.deltaTime, 0, 0));
}
}
}
