public LayerMask mask;
void Start()
{
//StartCoroutine(YY());
mask = LayerMask.GetMask(“chara”);
}
void Update()
{
RaycastHit2D hit = Physics2D.CircleCast(transform.position, 1f, Vector2.zero, mask);
if (hit.transform != null)
Debug.Log(hit.transform.name);
}
The GameObject hit all gameobject with Collider2D component in the scene, Am i wrong?