How to change shooting target with buttons

I have to shoot 2 different targets.I can choose which one to shoot but i want to do it directly by just pushing button “1” for the fisrt or “2” for the other and then just click to shoot.

var Force:int = 250;
var prefabshoot:Transform;
var target:Transform;
var minDistance:int;

function Update () {

pivotPoint = gameObject.transform.position;
pivotPoint = rotateArrow.pivotPoint;

spawnPoint = pivotPoint + Vector3(0, 5, 0);

shootDirection = target.position - spawnPoint;

shootDistance = Vector3.Distance(target.position, spawnPoint);


if(Input.GetMouseButtonDown(1))   {
if (shootDistance < minDistance ) {	
var instantiatedBall = Instantiate(prefabshoot, spawnPoint , Quaternion.identity);
instantiatedBall.rigidbody.AddForce(shootDirection* Force);
			}
	}
}

How can i put the different targets in here ? (i’ve made them as character controllers)

Add these target1 and target2 vars (where the targets will be defined) and add the selection part to the beginning of your Update function:

var target1:Transform;
var target2:Transform;

function Update(){

  if (Input.GetKeyDown("1")){
    target = target1;
  }
  if (Input.GetKeyDown("2")){
    target = target2;
  }
  pivotPoint = ...