Camera Rotates with the Player?

I am new to unreal engine or any other gaming engine. I always wanted to learn this programs and C++. I always wanted to create my own game. I am trying to understand how Unreal Engine works. First, I want to learn how the camera works. Well, I know the basics, such as rotating, moving, etc. I would like to know how can I create a blueprint that allows the camera to attach to the player and rotate when the player rotates.

For example, the player rotates 180 degrees.The camera rotates with the player as well without the move of the mouse and just the keywords. Could any one please explain to me how could this be done.

There is another thing about the camera I want to learn. How can I lock the camera onto the player, so if I try to move it with the mouse it won’t do anything. The camera will only follow the player and rotates with it.

Thank you!

In your Pawn blueprint you can add a camera component (and optionally a springarm).
In the cameras settings or the spring arm you can set whether to inherit control rotation on any of the three axes.

to keep the player pawn from rotating you can simply branch on a boolean variable in your input axis part of the blueprint (you set up input mappings for those events in your project settings), to not execute the Add Control Yaw (or other axis) node when the variable is true.

This is what I have. I created the camera component. I don’t know how to set to inherit control rotation and where to branch the boolean in the input axis?

That’s strange. I see a camera component varisble but no camera component (components can be added with the green button in the upper left corner)
Delete those variables and use the green button to add a real component (which will then also create a variale to keep track of it. It looks like you just have empty component variables that dont go to any actual components)

Okay, I got it. Now, I have no idea what to do next. I can see the camera settings, but I can’t where can I set inherit to control the rotation.

I found the solution. I added a couple of blueprints in the ThirdPersonCharacter and checked off pitch and roll from Spring Arm.