using UnityEngine;
using System.Collections;

public class Ghiaccio : MonoBehaviour
{
		private float initDrag;

		// Use this for initialization
		void Start ()
		{
	
		}
	
		// Update is called once per frame
		void Update ()
		{
	
		}

		void OnCollisionEnter (Collision other)
		{
				Debug.Log ("coll detect");
				if (other.collider.gameObject.CompareTag ("Player")) {
						Debug.Log ("player");
						initDrag = other.collider.gameObject.rigidbody.drag;
						other.collider.gameObject.rigidbody.drag = 0;
				}
		}
		void OnCollisionExit (Collision other)
		{
				if (other.collider.gameObject.CompareTag ("Player")) {
						other.collider.gameObject.rigidbody.drag = initDrag;
				}
		}
}
