Playing animation for object if hit by player camera s ray

Where is problem in my code?

function Update () {

	var hit : RaycastHit;
	var fwd = transform.TransformDirection (Vector3.forward);
	if (Physics.Raycast (transform.position, fwd, 2)) {

		if(hit.collider.gameObject.tag == "GameController") {
                    //Play animation


BTW how can i create new tag? When i click add tag, it creates new layer

Thank you ツ

You need that tag for your script to work. You set up tags by clicking the arrow on the top left side of the tag manager window.
the code you use to play the animation is


insert this snippet under your play animation comment