How do I create a third person shooter camera system?

I see a lot of people posting about this same setup but we haven’t been answered correctly yet, not even once. I’ve looked at both the first person shooter and third person blueprint starter packages. The problem I’m having and I’m sure other are having is how can we have a chase camera in the third person shooter that doesn’t rotate around the player mesh but turns the player mesh instead and setup camera zooming. Sometime along the lines of a Gears of War third person shooter chase camera system. Is this possible in Blueprint or does it require c++ coding?

Solution

To get a fixed camera with the mouse and gamepad input controlling the zoom of the camera (can change this to the mouse wheel or another button), replace the sections in the Third Person Blueprint with the following:

How to Use

Use the WASD keys to move, and then the Mouse up/down to zoom in and out - note that there’s no limits on the Spring Arm component target length, I’ll let you add these in :smiley:

How it Works

Zoom

Access the CameraBoom (a Spring Arm Component), whenever you’ve moved the mouse/gamepad up or down, get its current Target Arm Length, add it together with the LookUp amount (this could be positive or negative), and then set the current Target Arm Length to this. You could scale the difference between these two floats to zoom quicker.

Movement

We’re assuming that you’ll be facing the camera in only the X axis when moving around here. We access how much you’ve pressed the W/S keys (MoveForward, can be positive/negative) and add it to the X direction of a new vector, and add this to move the Player Pawn forward. We do the same with the A/D keys, and add it to the Y direction of a new vector, and add this to move the Player Pawn sidewards.

If you have any questions, feel free to post them below :slight_smile:

Edit

And I’ve just realised, I missed that you wanted to use the Mouse to control the player mesh rotation, silly me. I’ll have to add this in soon :slight_smile:

Thanks to Wes Bunn and his solution in this answer. This simple solution solves one of the problems, getting the mouse and joystick to move the character and camera at the same time.

If you simply what the character to
face the direction in which the mouse
is pointing, take a look at the 3rd
Person Blueprint Template and under
the Blueprints folder for My
Character, go to the Defaults tab and
search for Pawn. Check the User
Controller Rotation Yaw option and
that will allow the pawn to face the
direction the mouse is pointing.

Note: The character in this example
doesn’t animate and rotate towards the
camera, there would be a little more
involved in this.

Hope this helps points you in the
right direction (yes pun intended)!

-W

more ▼ answered 2 days ago Wes Bunn
gravatar image Wes Bunn :diamonds::diamonds:
1.4k ● 40 ● 4 ● 3

Continuing to build off the Third Person Blueprint Template, I’ve created a CameraZoom for both a joystick trigger and tab key on a keyboard, with variables that can be set in one location to keep things consistent between the 2.

Hello, the image depicting the solution is not accessible, nor it is available in google cache. Could you upload it again? Thanks. :slight_smile:

Wuhuuu… I finally fixed this ■■■■ myself after spending an entire day looking around… Omg… And then it was there inside the first person template. Go to MyCharacter blueprint defaults and then see screens for instructions.

Under character movement.

Now you should be all good. No need for changing anything in the eventgraph (in regards to movement)

Zoom is equally as easy. Tutorial here: Unreal Engine 4 Tutorial - Zooming Scope View - YouTube

Good luck.

/Kenneth

I see now that this is a pretty old thread, so you’ve probably figured it out by now :slight_smile:

Yeah, it has been a while and I have it all sorted out now.