confused with GetComponent

hi to all

I want to instantiate an object(RigidBody) when user press a GUIButton(attack). The GUIButton with instantiating script is attach to a empty game Object and the empty game Object is a child of my character. so I want to instantiate the rigidbody from my character controller script.
so what i think is i need to use my empty game Object to instantiate the rigid body. so to do this i need to use GetComponent(empty game object); in character controller script. But its a big confusion to me. How to do this ?

here is the code of my empty game object(weaponlauncher):

var cube : Rigidbody;
var Player : GameObject;
var speed =20;

function Update()
{

	
		
			var instantiatedProjectile : Rigidbody = Instantiate(cube, transform.position, transform.rotation );
			instantiatedProjectile.velocity = transform.TransformDirection(Vector3(speed,0,0));
			Physics.IgnoreCollision( instantiatedProjectile. collider,transform.root.collider );
			
			
	
	
}

here is my character controller script only the GUI function lines :

function OnGUI(){
	
	
	if(GUI.Button(Rect(300,300,80,20),"Attack"))
		{
			ins = GameObject.Find("weaponlauncher");
			insscript=(weaponlauncher)ins.GetComponent(typeof(weaponlauncher));
			insscript.Instantiate(cube, transform.position, transform.rotation );
		_characterState = CharacterState.Attacking;
		}
	
	}

i know what i have done is all silly. but i have told that i am confused so help me to understand this

hye guys no one to help me?

I don’t know if you have the below vars declared elsewhere but if you don’t you will be getting errors in the compiler;

Try this instead;

var ins = GameObject.Find(“TheObjectName”).GetComponent(ScriptName); //Find Correct Object
ins.SendMessage(“LaunchWeapon”, SendMessageOptions.DontRequireReceiver); //Send a call to fire weapon

Now inside the “weaponlauncher” script make a function called “LaunchWeapon”;

var cube : RigidBody;

function LaunchWeapon(){
Instantiate(cube, transform.position, transform.rotation );
_characterState = CharacterState.Attacking;
}

thanks caprica its working now
But my _characterState = CharacterState.Attacking; is not working
And i think i should learn SendMessage(); first