Changes sprites to look at mouse location

I want to have an player where the sprite changes to look at the mouse,
something like this
alt text

right now im just using a bunch of trigger polygon colliders to detect when the mouse enters them, but this seems really inefficient and dosent account for the camera zooming out

Could you just compare the transform.position of your main character to the transform.position of your mouse? If you have 8 directions, you could do something like this but mess with the ranges for the X, Y comparing.

lookDirectionX = mouse.transform.position.x - player.transform.position.x;
lookDirectionY = mouse.transform.position.y - player.transform.position.y;

     // Mouse is to left of player
if (lookDirectionX <= 0) {

     if (lookDirectionY < 0) {

          // Face character to LEFT, DOWN
     } else if (lookDirectionY > 0) {

          // Face character to RIGHT, DOWN
     } else if (lookDirectionY == 0) {

          // Face character LEFT

That’s how I would first try it, anyway. Let me know if that works!