// Update is called once per frame void OnTriggerEnter2D(Collider2D collider) { EnemyProjectile missile = collider.gameObject.GetComponent <EnemyProjectile>(); if (missile) { scoreManager.AddGrazeScore(grazePoints); } }