I keep getting this error message
NullReferenceException: Object reference not set to an instance of an object
PlayerController.FixedUpdate () (at Assets/_Completed-Assets/Scripts/PlayerController.cs:27)
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
private Rigidbody2D rb2d;
void start()
{
rb2d = GetComponent<Rigidbody2D> ();
}
void FixedUpdate()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector2 movement = new Vector2 (moveHorizontal, moveVertical);
rb2d.AddForce (movement);
}
}
I’m working on the ufo tutorial and have no idea what im doing wrong, thanks a bunch!