using System.Collections; using System.Collections.Generic; using UnityEngine; public class CheckGround : MonoBehaviour{ PlayerController player; // Start is called before the first frame update void Start(){ player = GetComponent(); } // Update is called once per frame void Update(){ } private void OnCollisionStay2D(Collision2D col){ if (col.gameObject.tag == "Ground"){ player.grounded = true; } if (col.gameObject.tag == "Fall"){ player.grounded = true; } } private void OnCollisionExit2D(Collision2D col){ player.grounded = false; } }