How to make player rotate with the camera

Hi, I have been trying to make my player rotate with the camera and when I move left with the mouse it moves the camera and the player and same way for up and down and left and right and I like for my camera to be able to not glitch out like when i was trying some things with camera when i get up to a wall and make the camera look forward the camare snips to the object but some times it bugs out and lets you see throw the wall anyone know how i do this using C++ and Blueprints?