Z targeting help

I’ve been searching for hours and cannot find any kind of tutorial or help with this issue.
Firstly the issue, I want my 3D action game to feature a “Z targeting” feature,
in which:

  • player presses a button

             -triggers automatic lock to the nearest enemy 
  • the camera and player pivot 360 degrees around the object/enemy

             - player always facing enemy
             - all attacks go towards enemy
             - dodge enemy attacks
                     - by pivoting right, left, and back
  • escaping camera lock if too far away

If anybody has any insight or suggestions to this issue please leave a comment. Thanks for your time