using UnityEngine;
using System.Collections;

public class Ventola : MonoBehaviour
{
		public float windPow;

		// Use this for initialization
		void Start ()
		{
	
		}
	
		// Update is called once per frame
		void Update ()
		{
				Vector3 dir = GameObject.FindGameObjectWithTag ("Player").transform.position - this.transform.position;
				dir.z = 0;
				float pow = windPow / (dir.magnitude * dir.magnitude);
				if (pow < 0.01f)
						pow = 0;
				if (!Luce.inTrigger)
						GameObject.FindGameObjectWithTag ("Player").rigidbody.AddForce (dir.normalized * pow);
		

		}
}
