private void OnTriggerEnter(Collider other) { if (other.CompareTag("enemy")) { kill(); } if (other.CompareTag("ground")) { snapObject = null; platCounter = 0; coordinates = other.GetComponent <SegmentController>().GetCoordinates(); if (other.GetComponent <SegmentController>().cellType == Cell.safe) { checkpoint = bVector; } } if (other.CompareTag("platform")) { platCounter++; } if (other.CompareTag("pit")) { pitCounter++; } if (other.CompareTag("mission")) { MissionController mcs = other.gameObject.GetComponent <MissionController>(); uiController.HoverEnter(mcs.endPoint, mcs.time); missionObject = other.gameObject; } if (other.CompareTag("missionend")) { uiController.EndEnter(); Destroy(other.gameObject); } }