Character Aim and Shoot on Mouse Cursor in 2D Platformer

assuming the mouse is projecting down onto a plane i think you want to use the Z not Y