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

HOw can i fix this error??

var walkAcceleration : float = 5;
var cameraObject : GameObject;
var maxWalkSpeed : float = 20;
@HideInInspector
var horizontalMovement : Vector2;

function Update ()
{
horizontalMovement = Vector2( rigidbody.velocity.x, rigidbody.velocity.z);
if (horizontalMovement.magnitude > maxWalkSpeed)
{
horizontalMovement = horizontalMovement.normalized;
horizontalMovement *= maxWalkSpeed;
}
rigidbody.velocity.x = horizontalMovement.x;
rigidbody.velocity.z = horizontalMovement.y;

transform.rotation = Quaternion.Euler(0,cameraObject.GetComponent(MouseLookScript).currentYRotation,0);
rigidbody.AddRelativeForce(Input.GetAxis(“Horizontal”) * walkAcceleration, 0, Input.GetAxis(“Vertical”) * walkAcceleration);
}

Either cameraObject is not set in the inspector, or the cameraObject that is being used doesn’t have a MouseLookScript attached, or the object that this script is attached to doesn’t have a rigidbody.

Either the gameobject this script is attached to do not have a rigidbody component or you forgot to set the var cameraObject : GameObject in your inspector.