shoot prefab at mouse point

hi friends i am trying to shoot prefab at mouse point can any one help me out

go = new GameObject[3];
var prefab:GameObject;
var prefab2:GameObject;
var prefab3:GameObject;
function Start(){

go[0]= prefab3;
go[1]=prefab;
go[2]=prefab2;
	var ins = Instantiate(go[Random.Range(0,3)], position, Quaternion.identity);
}

at present i am using above code to instantiate prefab randomly after instantiate how should i shoot randomly instantiated prefab at mouse point when i click my mouse button can any one help me please

Do your instatiation in Update like this…

function Update(){
if(Input.GetMouseButtonDown(0))
{

var ins = Instantiate(go[Random.Range(0,3)], position, Quaternion.identity);
}
}

After it is instantiated:

Make sure your prefab has a rigidbody and then try adding a script to your prefab with the following code:

public float power = 10f;

void Start()
{
rigidbody.AddForce(transform.forward * power, ForceMode.Force);
}

If it goes in a wonky direction, it could be a good idea to add unity’s standard assets ‘Smoothlookat’ script to the ‘launcher’ gameObject.

If the physics on the prefab is not behaving as you expect try different ForceModes (such as ForceMode.Impulse), I’m presuming you want to fire the prefab such that it travels in a straight line though, so ForceMode.Force should be fine.