Animation won't work. This error is givenn

NullReferenceException: Object reference not set to an instance of an object
Cannon_Fire.Update () (at C:/Users/User/Dropbox/Pirategame/Assets/Scripts/Cannon_Fire.js:28)

private var initialVelocity: float; // Starting Speed
private var cannonMuzzle: GameObject; // The Muzzle From where it shoots from
private var cannonBall: Rigidbody; // Place holder for the creation of the projectile
private var interaction: String; //interaction type
function Update () {
	initialVelocity = 200; // Setting speed
	cannonMuzzle = GameObject.Find("Cannon/Bone001/Cannonbone/Projectiles"); //Will find the ammo
	interaction = GameObject.Find("First Person Controller").GetComponent(Interactions).interaction; //Check interaction

 if (Input.GetKeyDown("mouse 0") && interaction == "Cannon") {
 	cannonBall = Instantiate(cannonballPrefab, cannonMuzzle.transform.position, cannonMuzzle.transform.rotation); // Creates the projectile
 	cannonBall.velocity = transform.TransformDirection(Vector3.forward * initialVelocity); // Add a forward motion onto it.
 	cannonMuzzle.particleSystem.Play(); // Play fire animation
 	**GameObject.Find("Cannon").GetComponent(Animation).animation.Play("Take001") ;**
 	
 }
}

I’ve tried a few attempts, but nothing worked.

Either there is no Cannon object, so GameObject.Find(“Cannon”) returns null. Or there is no Animation component on the Cannon object, so GetComponent(Animation) returns null. Or the animation property on the Animation component is not set, so it’s null. A way to check would be to separate those into separate lines of code…

GameObject cannon = GameObject.Find("Cannon");
Animation animationComponent = cannon.GetComponent(Animation);
animationComponent.animation.Play("Take001");

One of those should fail with the null reference exception, and that should tell you where the problem lies, or lead you to it.