enemy field of view unity code example
Example: unity 2d enemy field of view
if (Vector3.Distance(playerPosition, EnemyPosition) < 22.5)
{
Debug.Log("I'm seeing the player");
}
if (Vector3.Distance(playerPosition, EnemyPosition) < 22.5)
{
Debug.Log("I'm seeing the player");
}