Third Person Camera that moves behind the character

Hey so I want to make a third person camera that moves behind the character like in Battlegrounds. The camera stays behind the character and you can rotate it a little to the sides of the character, but the camera never goes in front of the character. When I hit a key such as Alt i want the camera to rotate freely. Anyone know any tutorials like this? I’ve been stuck on this problem for a while and it’s halted the progress of my first game. Thanks.

I don’t know how the camera from whichever Battlegrounds game work, so I made something from the rest of your description.
You can rotate the camera around the character, with a specified limiter. Is the limit-value reached, then it stops rotating.
When you hold down “alt” (actually only “left alt”, you should make it as input-value) then it skips the limiter and you can rotate it free, and when you stop holding down “alt”, then the camera jumps back behind the character.

Input actions:
Axis mapping → turn (mouse X), scale 1
Action mapping → pan (alt)

All in “Character_Blueprint”
At first, what you have to do:

  • on the left side “springArm” → details “camera settings” → uncheck “use pawn control rotation”
  • left “camera” → details “camera settings” → uncheck “use pawn control rotation”
  • create boolean “alt?”

Now you can follow the screenshot. Maybe not the best solution, but it works. ^^

Edit:
I found another interesting effect, maybe this is rather what you are looking for.

  • left “springArm” → details “camera settings” → uncheck “use pawn controller rotation”
  • left “camera” → details “camera settings” → check “use pawn controller rotation”
  • it does not need the blueprint script (except the “alt” for free rotation, but it looks strange)

Btw. when you want/already need your camera in a diagonal direction to your character, then try this:

  • springArm → details: camera → socket offset: Z (180) , (arm length: 300, location: Z (43) )
  • camera → details: transform → rotation: Y (-30)
    (other values in the same area are at default, like 0 and 1)

BTW here’s a video of the game so you can see what the camera rotation looks like: It's Almost Cheating - Battlegrounds - YouTube

Also I did what you said and the Camera is always directly behind him no matter which way I move my mouse. Is there a way for it to not always be completely right behind him, but have the ability to rotate a little to each side like in the video? And IK this is a different question, but how could I make it so that when I press S or A or D it would not move like W would? If move the character around I find that pressing any of the movement keys makes the character move forward as long as I rotate the character using the mouse. Is there a way for the keys to move by direction and not to rotate the character?

“have the ability to rotate a little to each side like in the video” I’m not sure how you mean it, because in the video is no rotation.
When you mean the “shake”, then you have to attach the camera or spring arm at the head (with camera, the effect is stronger).
When you mean the “side view” like at 2:53 in the video, that is based on the right run animation and not the camera movement.

For moving without automatic rotate of the camera: char_blueprint → on left side click on “char_blueprint(self)” → on the right side under details click uncheck “use controller rotation yaw” (at pawn).

I have edited the character blueprint from the standard “blueprint Third Person Project”.
I wanted to attach the exported file (.copy), but it does not work, also the .uasset is not allowed, so there is a download link at the bottom for the .uasset file, I hope it works. ^^

The changes:
I made a new spring arm and new camera. The spring arm has the head as parent socket and the camera has the endpoint of the spring arm.
I also changed the position from both to fit the position from the video.
When you make the uncheck change how I called above, you get a look at the “side view from animation”, because the char moves in the direction you press, like your last question, but it also have free rotation.

For free rotation with alt-key you have to make it in the event graph from char_blueprint like it is shown in the screenshot at my first answer.

Downloadlink (file-upload.net)

For smoother camera rotation you can check the “enable camera rotation lag” at spring arm details under “lag”.
(it is already checked in the edited downloadable file)

For parent socket: in character blueprint → click on spring arm and move it above your mesh, so it attachs to your mesh → then in details at sockets → click the magnifying glass to chose a parent.

To add it, you have to open your project into your pc folder like “C:\Unreal Projects*project_name*\Content\ThirdPersonBP\Blueprints”.
You can right-click in your content browser (in the engine) and click on “show in explorer” to open the right pc folder.
Also you must have the third person project files added to your project…

  • in engine click on the green “add new” button → at top “add feature or content pack” and chose “third person” in the blueprint tab
  • or create a new project → start engine → new project → blueprint tab → third person

Make sure you place the file in the right folder (ThirdPersonBP\Blueprints) and don’t change the name (you can it change in the engine).

delete/override/rename, but yes, you have to replace the original file.

“rotation” is rotation and “pitch” is also always for rotating and not for movement, no matter what the target is.
Here is now my solution for “camera up and down movement”. ^^
(the changes are highlighted)
(delta z is needed for up and down, x and y for the other directions)
(it also has a multiplier that can be changed or removed)

I’m not sure what you mean, but have you tried to change the “camera settings” (at details) from springArm or camera, like “use pawn control rotation”?
“CharacterMovement (inherited)” also has rotation settings that you can check out.

Hey thanks for all your help! How could I attach the camera spring arm at the head like you mentioned?

Also how do I import the .uasset? do I go to the game/ saved / autosaves / game / ThirdPersonBP / Blueprints and delete that .uasset and move the downloaded one there?

Do I delete the other .usasset file?

BTW how could I enable the camera to move up and down according to mouse movement? I tried use controller rotation pitch but it moves the character with it. Thanks

and also, when I change the direction with the W, A, S, or D keys, it seems that the character sort of spasms, as if It were trying to rotate to face a different direction, but it forced to stay facing that way