I was doing the Roll-A-Ball project and I entered in the code at the bottom of the page to roll the ball. I did watch the video and I did everything it said to do for setting up. After I finished copying in the code I saved it and clicked play. The ball did nothing when I pressed the arrow keys. I checked the console and it said this, twice.
“The referenced script on this behaviour is missing.”
Here is the code:
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);
}
}