making the beginner rollaball game from the tutorials and I copied the code exactly as they show it and I keep getting this error
NullReferenceException: Object reference not set to an instance of an object
heres 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);
}
just trying to get the ball to move, its saying the “rb.AddForce (movement);” is where im having an error
any help would be greatly appreciated!