NullRefernceException: Object reference not set to an instance of an object

here’s my script

var speed = 3.0;
var rotatespeed = 3.0;
var bullitPrefab:Transform;

function Update ()
{ 
      var controller :  CharacterController = GetComponent(CharacterController);
	  
	  // rotate around y - axis
	  transform.Rotate(0, Input.GetAxis ("Horizontal") * rotatespeed, 0);
	  
	  // Move forward / backward
	  var forward = transform.TransformDirection(Vector3.forward);
	  var curSpeed = speed * Input.GetAxis ("Vertical");
      controller.SimpleMove(forward * curSpeed);
	  
	 if(Input.GetButtonDown("Jump"))
     {
         var bullit = Instantiate(bullitPrefab,  
		                                 GameObject.Find("SpawnPoint").transform.position,  
										 Quaternion.identity);
		 bullit.rigidbody.AddForce(transform.forward * 2000);
	 } 
}

Several things could go wrong there, but the obvious places to search would be your calls to GetComponent and GameObject.Find. In particular, note that:

If the Transform to which the script above is attached does not contain a component of type CharacterController, then GetComponent returns null, and then the line controller.SimpleMove causes the exception, because controller is null.

If your project does not contain a GameObject with the name “SpawnPoint”, then GameObject.Find(“SpawnPoint”) returns null, in which case referencing its transform fails, in the line where you instantiate bullitPrefab.

So, to debug this one, add calls to Debug.Log immediately after each of the two calls listed above, and ensure that they in fact return what you expect them to.