You don’t have to refer to the gameObject
of the enemy, since the AIController
is a MonoBehaviour
you can just get the name
:
private void Update()
{
if (DistanceToPlayer() < chaseDistance)
{
Debug.Log($"{name} chasing the player");
}
}