void OnTriggerEnter2D(Collider2D col) { if (col.gameObject.GetComponent <obstacleBehaviour>()) { scorekeeper.Increment(); } else { gamekeeper.GameReset(); scorekeeper.ResetScore(); } }