I’ve found a targeting system here on the forums to fire a projectile at the nearest enemy to the player, it draws a debug sphere on the nearest enemy then every 1 second it fires a projectile towards them, it’s constantly ticking to find the nearest player, However when there’s only one enemy in the radius, it doesn’t track them and the projectile wont be fired. I thought it might be something to do with the array but I couldn’t figure it out.
The post I was using for reference - How to make my weapon attack the enemy nearest to it?