Unity doesn't think my script exists, PLEASE HELP!!!!!!!

Apparently this PlayerController script does not exist and will not be compiled:

using UnityEngine;
using System.Collections;

public class Player : MonoBehaviour {

public float moveSpeed;
public float jumpHeight;

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

// Update is called once per frame
void Update () {
	
	if(Input.GetKeyDown (KeyCode.Space)) 
	{
		rigidbody2D.velocity = new Vector2(0, jumpHeight);
	}


}

}

PLEASE HELP

Try to copy everything in your script to a new one, and add it to your object, and delete the previous one :slight_smile:

Hi mate,

It appears you are using an old version of the editor…did unity ask you to update your script to the newer API?
Under the assumption of you using UNITY 5, give this a try let me know how you go

using UnityEngine; 
using System.Collections;

public class Player : MonoBehaviour
{
	public float moveSpeed;
	public float jumpHeight;
	
	// Use this for initialization
	void Start ()
	{
	}    
	
	// Update is called once per frame
	void Update ()
	{
		if (Input.GetKeyDown (KeyCode.Space)) {
			GetComponent<Rigidbody2D>().velocity = new Vector2 (0, jumpHeight);
		}
	}
}