So, I’m trying the roll-a-ball tutorial, but when I follow his exact instructions and use this script:
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
private Rigidbody rb;
void Start ()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rb.AddForce (movement * speed);
}
}
I get an error in the console reading “The referenced script on the Behavior is missing” and when I double click it to take me to the issue, it shows the scrip with a message reading “The associated script can not be loaded. Please fix any compile errors and assign a valid script.”
What is going on, and is there any way to fix it?