S
S
strelok_10142021-01-29 18:29:15
C++ / C#
strelok_1014, 2021-01-29 18:29:15

How to fix error CS0117: 'Physics2D' does not contain a definition for 'OverlapArena'?

private void CheckTouchDamage()
    {
        if(Time.time >= lastTouchDamageTime + touchDamageCooldown)
        {
            touchDamageBotLeft.Set(touchDamageCheck.position.x - (touchDamageWidth / 2), touchDamageCheck.position.y - (touchDamageHeight / 2));
            touchDamageTopRight.Set(touchDamageCheck.position.x + (touchDamageWidth / 2), touchDamageCheck.position.y + (touchDamageHeight / 2));

            Collider2D hit = Physics2D.OverlapArena(touchDamageBotLeft, touchDamageTopRight, whatIsPlayer);

            if(hit != null)
            {
                lastTouchDamageTime = Time.time;
                attackDetails[0] = touchDamage;
                attackDetails[1] = alive.transform.position.x;
                hit.SendMessage("Damage", attackDetails);
            }
        }
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
strelok_1014, 2021-01-29
@strelok_1014

Instead of OverlapArena - you need to write OverlapArea

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question