using UnityEngine; using System.Collections; public class GroundCheckScript : MonoBehaviour { public PlayerMovementScript player; void OnTriggerEnter2D(Collider2D col) { if (col.tag == "Ground" || col.tag == "Platform") player.grounded = true; } void OnTriggerStay2D(Collider2D col) { if (col.tag == "Ground" || col.tag == "Platform") player.grounded = true; } void OnTriggerExit2D(Collider2D col) { if (col.tag == "Ground" || col.tag == "Platform") player.grounded = false; } }