Add force to an explosion...

Hi all i just want to ask how to add force to an explosion prefab which comes with unity and would like to know how to call the explosion on the click of the mouse button. this is how i want it to be like:

there are 5 boxes in the scene all boxes have rigidbody now when i click the mouse i want the explosion prefab to play. Now if the explosion is next to the boxes i want the boxes to move away and etc. And finally when i click on the mouse button anywhere on the screen that is where i want the explosion to happen

thanks in advance :)

the FPS tutorial shows you how to to this. But Why do you want to use the explosion that comes with unity? Download the Detonator Package from the asset store. the explosions are WAY more realistic and they add force to nearby rigidbodies too. you can even make customized explosions with that.

if(hit.rigidbody){

var force = 1000;

hit.rigidbody.Addforce(Vector3.forward * force);
}

Some starting points (if you want do it for yourself):

Ask if a mouse button is pressed with Input.GetMouseButtonDown, make a Physics.Raycast with a ray from the camera to the mouse click with Camera.main.ScreenPointToRay (Input.mousePosition) and then use networkZombie's answer or use Rigidbody.AddExplosionForce.