Hello Everyone,
I have a game with a bomb that creates a circle around the bomb once it hits an enemy. Everyone inside of that circle that is an enemy gets destroyed. However, I also want to see the circle in the game so I can readjust it to meet the radius that’s appropriate for it, but I can’t figure out how to do that. The code so far can be seen below:
using UnityEngine;
public class Explosion : MonoBehaviour
{
[SerializeField]
private float Range = 0.65f;
private GameObject Enemy;
private void OnCollisionEnter2D(Collision2D collision)
{
if (collision.collider.tag == "Enemy") {
Collider2D[] ColliderArray = Physics2D.OverlapCircleAll(transform.position, Range);
foreach (Collider2D collided in ColliderArray) {
if (collided.tag == "Enemy") {
Destroy(collided.gameObject);
}
}
}
}
}