Help on camera locking onto enemy, but remaining on player

To be more specific, I want to make it so when you press a button your camera locks onto an enemy but the player is visible. This is how the player is going to be able to kill the enemy easier than leaving the camera normally. I coded it so when you press the button it detects closest enemy, but I’m stuck on how to code the camera. Almost like mouse lock enables and locks onto the enemy.

Hey man! I wanted to make a lock on system too! This video helped me to do so!

Lock On

Appreciate it bro! Very useful!