I have followed all of the steps up to the point where the ball is about to be moved, my code is
using UnityEngine;
using System.Collections;
public class playerController : MonoBehaviour
{
void FixedUpdate()
{
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveHorizontal);
rigidbody.AddForce(movement);
}
}
and I have the playerController.cs linked with the Player object. When I click play and try to move the object nothing happens and I get the error:
Unity MissingComponentException: There is no 'Rigidbody' attatched to the "Player" game object, but a script is trying to access it.
The tutorial didn’t mention having to add this - what am I meant to do?