- Home /
Physics2D.OverlapCircleAll is not working well
Hi everyone im working on mobile platformer game and i want to add an AoE (area) attack so for that i use the gizmos. I draw a gizmos clearly and i can use it in my script but i've got a problem. While my objects ( the enemies in my case) are moving, my gizmos can't see them. For explain it, in my skill script
Collider2D[] enemiesToDamage = Physics2D.OverlapCircleAll(attackPosition.position, attackRange, EnemyLayer);
// For test it Debug.Log(enemiesToDamage.Length);
When my enemy stops, i can use my skill clearly and i can see them in my list. But when they move, i cant use my skill because my enemiesToDamage list hasn't got any element so i cant use my skill on the enemies which in the gizmos. How can i fix it?
Answer by b4guw1x · Aug 10, 2020 at 11:49 AM
I fixed this bug with moving my gizmos to middle of my character. In the edges, i cant figure it out but in this way i could solve my problem
Your answer
