using UnityEngine;
using System.Collections;

public class door_open : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
		RaycastHit hit = new RaycastHit();
		
		if(Physics.Raycast(transform.position, transform.forward, out hit, 5))
		{
			if(hit.collider.gameObject.tag == "door")
			{
				hit.collider.gameObject.animation.Play("door_open");
			}
		}
		
	}
	
	/*
	void OnControllerColliderHit (ControllerColliderHit hit) {
		
		if(hit.gameObject.tag == "door")
		{
			hit.gameObject.animation.Play("door_open");
		}
		
	}
	*/
}
