Object reference not set to an instance of an object

I’m new in unity and my code showing me this error

NullReferenceException: Object reference not set to an instance of an object
ShootScript.Update () (at Assets/Scripts/ShootScript.cs:30)

please tell me how to fix this.

using UnityEngine;
using System.Collections;

public class ShootScript : MonoBehaviour {

	Rigidbody arrowRigidBody;

	public int shootSpeed;
	public bool shootStart;
	public float xForce;
	public float yForce;
	public float movementSpeed;
	public float distance;

	void Start()
		arrowRigidBody = GetComponent<Rigidbody> ();

	void Update()
		if (shootStart)
			//float xtemp = Input.acceleration.x*xForce;
			//float ytemp = Input.acceleration.y*yForce;
			// ArrowRigidBody.velocity = new Vector3 (-xtemp,-ytemp,shootSpeed);
			arrowRigidBody.			transform.position = transform.position + Camera .main.transform.forward * distance * Time.deltaTime;


	public void stop()

		arrowRigidBody.velocity=new Vector3 (0,0,0);
		shootStart = false;


	public void setBoolea()

		shootStart = true;


There are two alternatives.

Either arrowRigidBody is null, in which case your GameObject doesn’t have a RigidBody component on it.

Or, Camera.main is null, in which case your scene doesn’t have a Camera with the MainCamera tag on it.

Double check the inspector.