I am trying to make the enemies face the player and I dont know what to do. I've tried this code but it didn't work:
void enemyRotatePlayer(sf::Sprite player) {
float angle = atan2(player.getPosition().y - enemy.getPosition().y, player.getPosition().x - enemy.getPosition().x) * 180 / 3.141;
enemy.setRotation(angle);
}