private void OnCollisionStay()

in Assets/Scripts/AsteroidController.cs [17:30]


    private void OnCollisionStay(Collision other)
    {
        if (!other.gameObject.CompareTag("Player")) return;

        if (currentTime <= 0f)
        {
            other.gameObject.GetComponent<HealthController>()?.DealDamage(damage);
            currentTime = damageCooldown;
        }
        else
        {
            currentTime -= Time.deltaTime;
        }
    }