using System.Collections; using System.Collections.Generic; using UnityEngine; public class NewBehaviourScript : MonoBehaviour { public GameObject Ground1, Ground2, Ground3; bool hasGround = true; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void SpawnGround() { } // platform "spawn" logic private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Ground")) { hasGround = true; } } private void OnTriggerExit2D(Collider2D collision) { if (collision.gameObject.CompareTag("Ground")) { hasGround = false; } } }