How are weapons aligned towards the mouse cursor location in top down games?

Hi, I have a player character in my top down project that can rotate to face the mouse cursor. Until now I’ve been using it without a weapon & it was working fine. But now I just added a hit scan based weapon & it’s not aiming directly at the mouse except for certain cursor locations, depending on the camera angle. How is this situation generally handled in top down games?