void OnTriggerExit2D(Collider2D other) { if (other.tag == "Pillar") { isPillar = false; pillarScript = null; putLocation = Vector2.zero; } if (other.tag == "Item") { onItem = false; temp = null; } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Item" && isHolding == false) { onItem = true; temp = other.gameObject; } if (other.tag == "Pillar") { isPillar = true; pillarScript = other.GetComponent <PuzzlePillar>(); putLocation = other.transform.position; //set the orb location putLocation.y += offSetY; // offset the y } }