gun holding

hi ive been working on a third person shooter and came across a question if my character where to switch his weapon from a rifle to a pistol how would i get my character to hold his gun like a pistol and not a rifle . Your help will greatly appreciated

I have had this question before, and I give my answer credit to @aldonaletto

Here is a gun pick up and swap script:

var hasRocketLauncher = false; // tells if you have a rocket launcher
var hasMachineGun = false; // tells if you have a machine gun
var ammoClips = 1; // tells how many ammo clips you have
var rockets = 10; // tells how many rockets you have
var Primary : GameObject;
var Secondary : GameObject;
 
private var inTrigger = false;
private var object: Transform;
 
function OnTriggerEnter(other: Collider){
inTrigger = true; // the player entered the trigger
object = other.transform; // save the object transform
}
 
function OnTriggerExit(other: Collider){
inTrigger = false; // the player left the trigger
}
 
function Update(){
// if player inside trigger and F pressed:
 
if (inTrigger && Input.GetKeyDown("f")){
switch(object.tag){
case "MachineGun":
hasMachineGun = true; // enable switching to the machine gun
Destroy(object.gameObject); // destroy the picked object
Primary.SetActiveRecursively(false);
Secondary.SetActiveRecursively(true);
if(Input.GetKeyDown("1")){
Primary.SetActiveRecursively(true);
Secondary.SetActiveRecursively(false);
}
break;
 
case "RocketLauncher":
hasRocketLauncher = true; // enable switching to the rocket launcher
Destroy(object.gameObject); // destroy the object
break;
case "AmmoClip":
ammoClips++; // increment ammo clips
Destroy(object.gameObject);
break;
case "Rocket":
rockets++; // increment rockets
Destroy(object.gameObject);
break;
}
}

Here is the link to my question and problems: http://answers.unity3d.com/questions/294476/weapon-pickup-and-change.html