Splinter cell cover swapping

Just wondering how would I go about setting up a cover swapping system similar to the splinter cell games, where if you look at a cover that’s in range you move to it with a button press. I imagine it’d involve a line trace with the positioning involving the camera in some way, but I just can’t figure it out.