i'm doing this live training called fun with explosions and get this error code and the sphere don't move ?

error NullReferenceException: Object reference not set to an instance of an object
Pook.OnMouseDown () (at Assets/Scripts/Pook.cs:20)

and here is the code :

public class Pook : MonoBehaviour {

public float force;
public Rigidbody rig;
RaycastHit hit;

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

void OnMouseDown()
    Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    if(Physics.Raycast(ray, out hit,100))
    rig.AddForceAtPosition(new Vector3(0, 0, force),hit.point,ForceMode.Impulse);



Check here or here.

ok , i try the same code in a new unity project and it work fine
i don’t know what was the problem
but that fix it .