//while triggered with obstacle private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("obstacle")) { Instantiate(effectbad, transform.position, Quaternion.identity); scorecalc.getScore(-1); } }
private void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("obstacle")) { //get 2 point scorecalc.getScore(2); } }