Access function in another script from another object?

Hi,
I have made a catapult where I want to launch some stones from. The catapult is animated so when I press ‘space’ my fire animation is loaded, and when this happens I would like to adress my ‘FiringScript’ attached to an empty gameObject where I want to spawn my stones.
Previosly I have been able to link to different functions in different scripts, but now I cant make it work.
My script on the catapult is:
function Update () {
if (Input.GetKeyDown (“space”))
{
animation.Play(“Fire”);
print(“FIRE!”);
AmmoRockConstructor = true;
print(“AmmoRockConstructor is true”);
FiringScript.fire(); ← I also tried accessing it with this line
}
My script on the empty gameobject:
var AmmoRockConstructor = false;
var fireSound : AudioClip;
var AmmoRock : Rigidbody;
var fireForce : float;
function fire()
{
if(AmmoRockConstructor==true)
{
audio.PlayOneShot(fireSound);
var AmmoRock : Rigidbody = Instantiate(AmmoRock, transform.position, transform.rotation);
AmmoRock.rigidbody.velocity = transform.TransformDirection(Vector3(0,0, fireForce));
//Physics.IgnoreCollision(transform.root.collider, AmmoRock.collider, true);
AmmoRock.name = “AmmoRock”;
print(“FIRED!!!”);
}
}
@script RequireComponent(AudioSource)

I did manage to spawn the stones and play the animation, but not at the same time and linked.
I have attached a screenshot.
Hope anyone has the golden point :slight_smile:
-Take care

otherObject.GetComponent(FiringScript).fire();

And if you don’t have the object linked:

GameObject.Find("myObject").GetComponent(FiringScript).fire();

Oki, it worked. Thanx a lot guys.
Why did it work for me previously to just type scriptname.function ?
Because it was attached to the samme object?

How can I make sure the stone is released exactly when my animation is finished playing? (I have a firing animation, where the catapult-arm needs to reach its max before unleashing the stone)