using UnityEngine;
using System.Collections;

public class invisiableplayer : MonoBehaviour {

	private SpriteRenderer spriteRenderer;

	void Start(){
		spriteRenderer = GetComponent <SpriteRenderer>();
	}

	void OnTriggerEnter2D(Collider2D other){
		if(other.tag=="grass"){
			spriteRenderer.enabled=false;
		}

	}

	void OnTriggerExit2D(Collider2D other){
		if(other.tag=="grass"){
			spriteRenderer.enabled = true;
		}

	}

	void OnTriggerStay2D(Collider2D other){
		if(other.tag=="grass"){
            spriteRenderer.enabled = false;
		}

	}
	
}
