private void Update() { RaycastHit2D hitInfo = Physics2D.Raycast(transform.position, transform.up, distance, whatIsSolid); if (hitInfo.collider != null) { _randCrit = Random.Range(0, 100); //Debug.Log(_randCrit); if (_randCrit > 0 && _randCrit < 10) { _player.CriticDamage(); damage = baseDamage * 2; } else { damage = baseDamage; } if (hitInfo.collider.CompareTag("Enemy")) { //Debug.Log("projectile does " + damage); hitInfo.collider.GetComponent <EnemyScript>().TakeDamage(damage); _cursor.RutineInterceptor(); } else if (hitInfo.collider.CompareTag("Boss")) { hitInfo.collider.GetComponent <BossBehavoiur>().TakeDamage(damage); _cursor.RutineInterceptor(); } DestroyProjectile(); } transform.Translate(Vector2.up * speed * Time.deltaTime); }