This was to avoid the enemy of getting stuck, so if it doesn't find the player in a certain amount of time it respawns. But I think I forgot to consider if the player is nearby.Thank you for playing!